В этой работе будет проанализирован датасет про 501 комикс, а так же ~12000 отзывов пользователей о них. Далее будут созданы 2 рекомендательные системы: content-based и collaborative filtering, к каждой будут написаны одна или несколько функций. В конце анализа будет произведена оценка каждой из систем.
На стадии предобрадотки проекта были проведены текстовый и сетевой анализы. Некоторые из выводов были использованы в дальнейшем пи построении рекомендательной системы. Начнем с текстового анализа.
# загружаем библиотеки
library(tidytext) # обработка текста
library(ggplot2) # графики
library(wordcloud2) # облака слов
library(tidyr) # переформатирование таблиц (длинный - широкий формат, например)
library(stringr) # обработка строк (удаление, поиск, замена символов)
library(dplyr) # преобразование данных
library(stopwords)
library(textstem)
library(kableExtra)
library(data.table)
library(igraph)
library(dplyr)
library(stringr)
library(RColorBrewer)
library(ggplot2)
library(kableExtra)
library(yardstick)
library(readr)
library(tidyr)
library(tidyverse)
#library(broom)
library(coin)
library(rpart)
library(rpart.plot)
library(lubridate)
library(haven)
library(readr)
library(threejs)
library(visNetwork)
library(ggraph)
#загрузка данных
load("~/shared/minor2_2020/data/good_read/books_g_3.RData")
load("~/shared/minor2_2020/data/good_read/reviews_g_3.RData")
Текстовый анализ будет состоять из двух частей. В первой части будет проведен сентимент-анализ отзывов о каждом комиксе, а так же будет выделена единая эмоциональная оценка комикса. Вторая часть будет посвящена тематическому моделированию и присвоению комиксу номера темы для дальнейшего использования в создании рекомендательной системы.
reviews <- goodread_reviews %>% right_join(goodread_comics) %>% select(book_id, review_text, rating)
reviews_tidy <- reviews %>% unnest_tokens(words, review_text, token = "words")
stop_words = data.frame(words=stopwords("en"), stringsAsFactors=FALSE)
reviews_tidy_1 <- reviews_tidy %>% anti_join(stop_words)
reviews_tidy_1$words <- lemmatize_words(reviews_tidy_1$words)
# используем словарь afinn
sentdict = get_sentiments("afinn")
new_tidy = reviews_tidy_1 %>% inner_join(sentdict, by = c("words"="word"))
new_review_sent = new_tidy %>%
group_by(book_id) %>%
summarize(sent = mean(value))
Итак, мы использовали словарь afinn, чтобы получить сентимент оценку каждому комиксу. Затем мы усредняем эту оценку для каждого комикса. Именно этот показатель будет использован в дальнейшем в content-based системе.
#добавляем колонку к общему датасету
goodread_comics = goodread_comics %>% left_join(new_review_sent)
goodread_comics %>% select(title, sent) %>% arrange(-sent) %>% head()%>% kbl() %>% kable_styling()
| title | sent |
|---|---|
| Blacksad. Un lugar entre las sombras (Blacksad, #1) | 2.769231 |
| Kartun Benny & Mice: Jakarta Luar Dalem | 2.666667 |
| Snow White and the Seven Robots: A Graphic Novel | 2.472222 |
| Yotsuba&!, Vol. 03 (Yotsuba&! #3) | 2.298507 |
| బారిష్టర్ పార్వతీశం [Barrister Parvateesam] | 2.233333 |
| Lumberjanes To The Max Edition, Vol. 1 | 2.216216 |
library(topicmodels)
comics <- goodread_comics %>% select(book_id, description, average_rating)
comics_tidy <- comics %>% unnest_tokens(words, description, token = "words")
comics_tidy <- comics_tidy %>% anti_join(stop_words)
comics_tidy$words <- lemmatize_words(comics_tidy$words)
comics_tidy_1 = comics_tidy %>% group_by(book_id, words) %>% count()
comics_dtm = cast_dtm(comics_tidy_1, book_id, words, n)
ap_lda = LDA(comics_dtm, k = 10, control = list(seed = 1234))
ap_documents = tidy(ap_lda, matrix = "gamma")
ap_topics = tidy(ap_lda, matrix = "beta")
# теперь выделим для каждого комикса наиболее вероятную тему, к которой он может принадлежать
doc_topic_set = ap_documents %>% group_by(document) %>% summarise(topic = topic[which(gamma == max(gamma))])
doc_topic_set = doc_topic_set %>% rename(book_id = document)
doc_topic_set$book_id = as.numeric(doc_topic_set$book_id)
#doc_topic_set
Заметим, что здесь 483 документа, а в исходном датасете - 501, причиной может послужить (1) факт, что мы использовали лемматизацию для английских слов, а у некоторых комиксов в описании есть иероглифы, либо (2) - у комиксов попросту нет описания. Поэтому все такие комиксы мы определим в дополнительную категорию.
#присоединяем топик к датасету
goodread_comics = goodread_comics %>% left_join(doc_topic_set)
goodread_comics$topic[is.na(goodread_comics$topic)] = 0
Можем так же посмотреть на наиболее часто встречающиеся слова в каждой теме
review_top_terms <- ap_topics %>%
group_by(topic) %>%
top_n(5, beta) %>%
ungroup() %>%
arrange(topic, -beta)
review_top_terms %>%
mutate(term = reorder(term, beta)) %>%
ggplot(aes(term, beta, fill = factor(topic))) +
geom_col(show.legend = FALSE) +
facet_wrap(~ topic, scales = "free") +
coord_flip()
В некоторых темах уже по 5-ти словам можно понять, о чем этот топик. Например, в теме 8 слова Бэтмен и Готэм явно указывают на то, что документы этой темы объединены комиксами про Бэтмена. Аналогично, топик 4 посвящен человеку-пауку, а топик 7 - людям Х.
В ходе анализа отзывов и описаний комиксов были выделены 2 новых показателя: средняя эмоциональность отзывов о комиксе и принадлежность к одной из 11 тем. Эти показатели будут использованы в дальнейшем при построении content-based рекомендательной системы.
Теперь перейдем к анализу сети, построенной на основе нашего датасета. В нем мы рассмотрим разделение на кластеры, меры центральности, а так же визуализацию сети.
Создадим сеть на основе датасета reviews. Выводы, полученные при помощи анализа старой сети, будут не столь эффективны, чем выводы при анализе новой, поскольку последние будут более актуальны и будут соотноситься с выданными нам датасетами.
# Создание матрицы смежности и сети
r = reviews %>% dplyr::select(user_id, book_id, rating)
r = pivot_wider(r, names_from = book_id, values_from = rating)
user_names = r$user_id
r = dplyr::select(r, - user_id)
r = as.matrix(r)
rownames(r) = user_names
r = as(r, "realRatingMatrix")
similarity = similarity(r, method = "cosine", which = "items")
similarity = as.matrix(similarity)
diag(similarity) = 1
similarity = replace_na(similarity, 1)
similarity_graph = 1 -similarity
similarity_graph[similarity_graph >= 0.25] = 1
similarity_graph[similarity_graph < 0.25] = 0
similarity_graph = as.matrix.data.frame(similarity_graph)
net = graph_from_adjacency_matrix(adjmatrix = similarity_graph, mode = "undirected")
nice = layout_nicely(net)
V(net)$name = rownames(similarity)
plot(net, vertex.label = NA, vertex.size = 4)
Сеть выглядит интересно, однако полумесяц данных вызывает опасения по поводу эффективности кластеризации. Посмотрим, что скажет кластеризация сети и модулярность.
Мы рассмотрим такие методы кластеризации, как: fast greedy, walktrap, label propagation, eigenvector, multilevel, infomap. Ниже представлены результаты модулярности по этим методам:
for(method in list(fastgreedy.community,walktrap.community,label.propagation.community,leading.eigenvector.community,multilevel.community,infomap.community)){
modul = modularity(method(net))
print(modul)
}
## [1] 0.5401713
## [1] 0.4960942
## [1] 0.428334
## [1] 0.53605
## [1] 0.5705678
## [1] 0.5517221
#Label Propagation
lpcommune=label.propagation.community(net)
lpcommune_m=modularity(lpcommune)
#Walktrap
wtcommune=walktrap.community(net, steps=5)
wtcommune_m=modularity(wtcommune)
#Information Map
imcommune=infomap.community(net, nb.trials=5)
imcommune_m=modularity(imcommune)
#Fast Greedy
fgcommune = fastgreedy.community(net)
fgcommune_m=modularity(fgcommune)
#Multilevel
mlcommune=multilevel.community(net)
mlcommune_m=modularity(mlcommune)
Модулярность оказалась не столь высокой, как полученная нами при анализе старой сети в домашних заданиях и при подготовке к групповому (максимум 0.57 у метода Multilevel). Скорее всего, это обсулавливается полумесяцем из данных на графике. Посмотрим на графиках, какая вышла кластеризация сети на сообщества.
#Multilevel Modularity - 273 сообщества
plot(mlcommune, net,
vertex.label.color = "black",
vertex.label.cex = 0.006,
vertex.size = 2,
edge.color = 'gray',
main = "Разбиение с помощью Multilevel",
layout = nice)
#Information Map Modularity - 289 сообществ
plot(imcommune, net,
vertex.label.color = "black",
vertex.label.cex = 0.006,
vertex.size = 2,
edge.color = 'gray',
main = "Разбиение с помощью Information Map",
layout = nice)
#Walktrap Modularity - 303 сообщества
plot(wtcommune, net,
vertex.label.color = "black",
vertex.label.cex = 0.006,
vertex.size = 2,
edge.color = 'gray',
main = "Разбиение с помощью Walktrap",
layout = nice)
Всё верно, огромное количество сообществ объясняется полумесяцем - данные разрознены, что заставляет выделить их в отдельные группы, и минимум 2/3 всех кластеров находятся в полумесяце.
Посмотрим количество представителей у каждого кластера по методу Multilevel
membership = membership(mlcommune)
books$commune = membership
books %>%
count(commune) %>%
top_n(15, n) %>%
ggplot(aes(x = reorder(commune, n), y = n))+
geom_col()+
theme_classic()+
coord_flip()+
geom_text(aes(label = n, hjust = -0.1))+
labs(y = "Число комиксов в кластере", x = "Номер кластера")
Итого, у нас 11 кластеров, где сгрупированно более 2 произведений, остальные 260 с лишним кластеров включают в себя от одного до двух комиксов. Самые крупные кластеры - 204 с 45 комиксами и 206 с 35 комиксами. Следующие три крупных - 263, 218 и 235 с количеством комиксов 26, 25 и 23 соответственно. Далее три кластера по 18 комиксов (269, 236, 182). Проверим ассортативность распределения по кластерам
#сообщество делаем фактором, так как это дискретная величена
V(net)$commune=books$commune
assortativity_nominal(net, as.factor(V(net)$commune), directed = F)
## [1] 0.7867655
Ассортативность равна 0.79, что означает высокую связь между способом распределения на кластеры, данным multilevel.community, и оценкой пользователей. Найдем самый центральный комикс для каждого кластера по betweenness.
net$community = membership
communities = data.frame()
for (i in unique(net$community)) {
subgraph = induced_subgraph(net, v = which(net$community == i))
size = igraph::gorder(subgraph)
btwn = betweenness(subgraph)
communities = communities %>%
bind_rows(data.frame(
community = i,
n_characters = size,
most_important = names(which(btwn == max(btwn)))
)
)
communities = communities %>% arrange(-n_characters)
}
important = list()
for(i in communities$most_important){
name = books$title[books$book_id == i]
important = important %>% append(name)
}
communities$label = do.call(cbind.data.frame, important) %>% t()
communities = communities %>% dplyr::select(-most_important)
head(communities,10)%>% kbl() %>% kable_styling()
| community | n_characters | label |
|---|---|---|
| 204 | 45 | Marzi |
| 206 | 35 | Batwoman: Elegy |
| 263 | 26 | Calamity Jack (Rapunzel’s Revenge, #2) |
| 218 | 25 | Superman: Sacrifice |
| 235 | 23 | Trinity Blood, Vol. 1 |
| 236 | 18 | Saga, Vol. 1 (Saga, #1) |
| 269 | 18 | Lumberjanes To The Max Edition, Vol. 1 |
| 182 | 18 | New X-Men by Grant Morrison Ultimate Collection - Book 1 |
| 234 | 12 | Lucille |
| 259 | 6 | Fogtown |
Кластер 204 - Vertigo - Marzi
Кластер 206 - DC Comics - Batwoman: Elegy
Кластер 263 - Bloomsbury USA Childrens - Calamity Jack (Rapunzel’s Revenge, #2)
Кластер 218 - DC Comics - Superman: Sacrifice
Кластер 235 - Unknown - Trinity Blood, Vol. 1
Кластер 236 - Image Comics - Saga, Vol. 1 (Saga, #1)
Кластер 269 - BOOM! - Lumberjanes To The Max Edition, Vol. 1
Кластер 182 - Marvel - New X-Men by Grant Morrison Ultimate Collection - Book 1
И мы снова видим, что почти половину топ-10 занимают первые части комиксов или манг, однако столь же важно заметить, что в топе новой сети гораздо больше независимых комиксов, которые выпускались одной частью (либо номер части не написан)
Посмотрим на центральные комиксы новой сети. Будем использовать такие меры центральности, как degree, betweenness, eigen vector. Итого:
Наиболее центральный комикс по degree - количеству путей, проходящих через узел - “The Boy Who Crashed to Earth (HiLo #1)” со значением 28
Наиболее центральный комикс по betweenness - “Batwoman: Elegy” со значением 4711.13
Наиболее центральный комикс по eigen centrality - “The Boy Who Crashed to Earth (HiLo #1)”
Стоит заметить, что если в старой сети максимальное значение degree было 109, то в новой сети - всего лишь 28.
Рассмотрим, насколько сильно отличаются результаты degree, betweenness и eigen centrality, а именно, рассмотрим их корреляцию и топ10 по каждому параметру
Можно выделить очень высокую корреляцию между degree и eigen centrality - 0.9, менее высокую между degree и betweenness - 0.66, и низкую корреляцию между eigen centrality и betweenness - 0.38. Посмотрим, видно ли в топ10 по трем мерам центральности данную корреляцию.
| degree | betweenness | eigen_centrality |
|---|---|---|
| The Boy Who Crashed to Earth (HiLo #1) | Batwoman: Elegy | The Boy Who Crashed to Earth (HiLo #1) |
| Last Man: The Stranger (Last Man, #1) | Marzi | Log Horizon, Vol. 1 (Log Horizon Manga, #1) |
| Log Horizon, Vol. 1 (Log Horizon Manga, #1) | New X-Men by Grant Morrison Ultimate Collection - Book 1 | Last Man: The Stranger (Last Man, #1) |
| Marzi | The Incredible Hulk, by Jason Aaron, Volume 1 | Steven Universe Vol. 1 |
| Steven Universe Vol. 1 | Amazing Spider-Man, Vol. 1: The Parker Luck | Russian Olive to Red King |
| Russian Olive to Red King | Blood Work (The Hollows Graphic Novel, #1) | Brass Sun: The Wheel of Worlds |
| Brain Camp | Calamity Jack (Rapunzel’s Revenge, #2) | Marzi |
| Brass Sun: The Wheel of Worlds | Gotham Academy, Vol. 3: Yearbook | They’re Not Like Us, Vol. 1: Black Holes for the Young |
| The Tiger (Love, #1) | Girls: Conception (Girls, #1) | Sensation Comics Featuring Wonder Woman Vol. 1 |
| They’re Not Like Us, Vol. 1: Black Holes for the Young | Brain Camp | The Tiger (Love, #1) |
Корреляция очевидна: у degree и eigen centrality много одинаковых комиксов, betweenness же отличается своим набором топ10 как от degree, так и от eigen centrality, разве что от последнего отличается больше - например, в degree и betweenness есть комикс Brain Camp, который отсутствует в топ 10 по eigen centrality.
И мы снова видим множество первых частей, а также уже известных нам и центральных в своих кластерах Marzi и Batwoman: Elegy.
Интересно, какие комиксы самые популярные в нашей сети по количеству отзывов?
Очевидно, что это Saga, Часть Первая, хотя по какой-то причине существует две книги с таким названием - возможно, ошибка системы отзывов goodreads, поскольку комикс тот же, различие лишь в способе названия номера части. При этом примечательно, что оба комикса являются единственными комиксами, на которые было дано более ста тысяч отзывов.
А сможем ли мы увидеть сообщества комиксов с похожими оценками на графике?
#Упорядочиваем датасет
vertices = data.frame(book_id = as.numeric(V(net)$name))
vertices = left_join(vertices, books)
books = vertices
# Добавление аттрибутов к сети
books$average_rating = as.numeric(books$average_rating)
books$ratings_count = as.numeric(books$ratings_count)
books$num_pages = as.numeric(books$num_pages)
books$authors.0.author_id = as.numeric(books$authors.0.author_id)
books$authors.1.author_id = as.numeric(books$authors.1.author_id)
books$book_id = as.numeric(books$book_id)
V(net)$author_0 = books$authors.0.author_id
V(net)$author_1 = books$authors.1.author_id
V(net)$mean_rate = books$average_rating
V(net)$n_pages = books$num_pages
V(net)$popularity = books$ratings_count
V(net)$shelf_0 = books$popular_shelves.0.name
V(net)$popular_shelves.1.name = books$popular_shelves.1.name
V(net)$shelf_2 = books$popular_shelves.2.name
V(net)$shelf_3 = books$popular_shelves.3.name
V(net)$publisher = books$publisher
V(net)$name = books$book_id
Визуализируем ту часть сети, где наибольшая центральность (betweenness)
#Визуализация части сети, где центральность наибольшая
g = induced_subgraph(net, degree(net)>15)
ggraph(g)+
geom_node_point(size = betweenness(g))+
geom_edge_link(alpha = 0.7)+
geom_node_label(aes(label = name))+
ggtitle("Репрезентация части сети, \nгде ноды с наибольшей центральностью")+
theme_graph()
А сможем ли мы увидеть на графике сообщества комиксов, которые похожи не только по оценкам, но и по жанру?
Из графика видно, что сообществ комиксов по жанру с похожими оценками в принципе нет, они все рассеяны по сети. Для проверки, есть ли какая-либо логика в этом распределении, посмотрим коэффициент ассортативности.
## [1] 0.02273463
Коэффициент ассортативности равен 0.02, что означает, что отсутствует даже слабая связь между жанром комикса и оценкой пользователей.
Также мы можем посмотреть на распределение по издателю-вселенной:
load("~/shared/minor2_2020/data/good_read/books_g_3.RData")
goodread_comics %>% group_by(publisher) %>% count() %>% arrange(-n)
## # A tibble: 120 x 2
## # Groups: publisher [120]
## publisher n
## <chr> <int>
## 1 "Marvel" 85
## 2 "" 56
## 3 "DC Comics" 52
## 4 "Image Comics" 46
## 5 "Vertigo" 27
## 6 "Marvel Comics" 15
## 7 "VIZ Media LLC" 15
## 8 "Dynamite Entertainment" 10
## 9 "Yen Press" 9
## 10 "First Second" 8
## # … with 110 more rows
Значительную часть занимают Марвел, DC и Image Comics. Так как one-hot-encoding по всем издателям добавит более 100 новых колонок, мы сделаем 3 колонки, где будет отображено, является ли комикс Марвел, DC, Image Comics или ни одним из перечисленных.
Большинство комиксов принадлежат Марвел, DC и Image Comics
Центральные позиции зачастую принадлежат комиксам - первым частям
Центральные комиксы - The Boy Who Crashed to Earth (HiLo #1); Batwoman: Elegy; Marzi; Log Horizon, Vol. 1 (Log Horizon Manga, #1); Last Man: The Stranger (Last Man. #1); New X-Men by Grant Morrison Ultimate Collection - Book 1
Крупных кластеров всего ~10 из 273, остальные состоят из одного-двух комиксов
Наиболее популярный комикс по количеству отзывов - Saga, Vol. 1, причем дважды
Выделить первые части - затруднительно, так как где-то она указана, где-то нет, где-то комикс состоит в целом из одной части. Поэтому мы добавим к исходным данным только колонки о вселенных.
Добавим все колонки с информацией, выявленной в ходе двух анализов.
#так как DC владеет Verigo, учтем их вместе
dc = ifelse(goodread_comics$publisher == "DC Comics" | goodread_comics$publisher == "Vertigo" , 1, 0)
marvel = ifelse(goodread_comics$publisher == "Marvel" | goodread_comics$publisher == "Marvel Comics", 1, 0)
image_comics = ifelse(goodread_comics$publisher == "Image Comics", 1, 0)
#### Итоговый датасет для content-based рекомендательной системы:
goodread_comics$marvel = marvel
goodread_comics$dc = dc
goodread_comics$image_comics = image_comics
goodread_comics = goodread_comics %>% left_join(doc_topic_set)
goodread_comics$topic[is.na(goodread_comics$topic)] = 0
goodread_comics = goodread_comics %>% left_join(new_review_sent)
mean_rating = reviews %>% group_by(book_id) %>% summarize(rating = mean(rating))
goodread_comics = goodread_comics %>% left_join(mean_rating)
Так как в методе коллаборативной фильтрации используются исключительно рейтинги фильмов, проставленные пользователями, вышенаписанный анализ понадобится нам при написании content-based системы. Перейдем непостредственно к системам.
Методом был выбран IBCF, то есть фильтрация основывается на комиксах.
#оставляем только оценки пользователей и книги
load("~/shared/minor2_2020/data/good_read/reviews_g_3.RData")
goodread_reviews_cf = select(goodread_reviews, -review_id, -date_added,-review_text)
#Преобразуем к таблице в "широком" формате
rates = pivot_wider(goodread_reviews_cf, names_from = book_id, values_from = rating)
Примечание: на первый взгляд может показаться странным, что мы не убираем пользователей с маленьким количеством оценок, однако после нескольких проверенных вариантов вручную, начальные данные дают ошибку MAE примерно 0.92, в то время как при фильтрации по количеству оценок ошибка варьируется в диапозоне 1.10 - 1.20. Поэтому мы оставим датасет в исходном виде.
#преобразуем в объект realRatingMatrix и фильтруем по количеству оценок
userNames = rates$user_id
rates = select(rates, -user_id)
rates = as.matrix(rates)
rownames(rates) = userNames
r = as(rates, "realRatingMatrix")
ratings_books <- r[rowCounts(r) > 0, colCounts(r) > 0]
#строим модель оценивания
set.seed(100)
eval_sets <- evaluationScheme(data = ratings_books,
method = "split",
train = 0.8, # доля обучающей выборки
given = 1, # сколько оценок используется для предсказания
goodRating = 4) # если предсказанная оценка < 4, то фильм не рекомендуем
recc_model_ibcf <-
Recommender(data = getData(eval_sets, "train"), method = "IBCF")
recc_predicted_ibcf <-
predict(
object = recc_model_ibcf,
newdata = getData(eval_sets, "known"),
n = 6,
type = "ratings"
)
eval_accuracy2 <- calcPredictionAccuracy(x = recc_predicted_ibcf,
# predicted values
data = getData(eval_sets, "unknown"),
byUser = F)
eval_accuracy2
## RMSE MSE MAE
## 1.4472842 2.0946315 0.9266075
Система в среднем ошибается на 0.92 балла. Однако этого недостаточно, чтобы наверняка сказать, хорошо работает алгоритм или нет. Проведем еще 2 этапа оценивания, предварительно обернув все в функцию.
#строим теперь уже общую модель для всех юзеров
recc_model <- Recommender(data = ratings_books, method = "IBCF")
Теперь для автоматизации получения рекомендаций “обернем” код в функцию.
comics_function_CF = function(user_id, n_comics){
recc_predicted = predict(object = recc_model, newdata = ratings_books, n = n_comics)
recc_user <- recc_predicted@items[[user_id]]
if (length(recc_user)==0) {
rec = goodread_comics %>% arrange(-rating) %>% top_n(n_comics)%>% select(title, rating, publisher, description)
rec = knitr::kable(rec, col.names = c("Похожий комикс", "Средняя оценка","Вселенная", "Описание")) %>% kable_styling()
} else {
comics_user <- recc_predicted@itemLabels[recc_user]
names_comics_user <- goodread_comics$title[match(comics_user, goodread_comics$book_id)]
rec = data.frame(comics = names_comics_user, book_id = as.numeric(comics_user)) %>% left_join(goodread_comics) %>% select(title, rating, publisher, description)
rec = knitr::kable(rec, col.names = c("Похожий комикс", "Средняя оценка","Вселенная", "Описание")) %>% kable_styling()
}
rec
}
Описание функции: данная функция принимает на вход id пользователя и количество комиксов, которое он/она хочет получить в качестве рекомендации. Если пользователь новый, то ему нужно указать только количество комиксов - тогда система выдаст ему список комиксов с наивысшей средней оценкой.
comics_function_CF("f8019b36ddc20e8062a4260851a1efe0", 2)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Transmetropolitan, Vol. 7: Spider’s Thrash (Transmetropolitan, #7) | 4.148148 | Vertigo | The hammer has come down on him but outlaw journalist Spider Jerusalem has managed to stay one step ahead of his detractors - I.e. the President of the United States and his authoritarian lackeys in publishing and law enforcement. After losing his byline, bank account, and apartment, Jerusalem and his Filthy Assistants have legged it underground, the better to implement his plan. What plan, you say? Why, the plan to bring down the President of course! |
| House of M | 3.780000 | Marvel | The Marvel event of the decade is here! The Avengers and the X-Men are faced with a common foe that becomes their greatest threat: Wanda Maximoff! The Scarlet Witch is out of control, and the fate of the entire world is in her hands. Will Magneto help his daughter or use her powers to his own benefit? Starring the Astonishing X-Men and the New Avengers! You know how sometimes you hear the phrase: and nothing will ever be the same again? Well, this time believe it, buster! Nothing will ever be the same again! Collecting: House of M1-8 & Pulse: House of MSpecial Edition Newspaper |
comics_function_CF(n_comics = 2)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Lone Wolf and Cub, Vol. 28: The Lotus Throne | 4.900000 | Dark Horse Manga | What exactly needs to be said in solicitation copy for the VERY LAST VOLUME OF LONE WOLF AND CUB? It’s the moment you’ve all been waiting years and years to read. It’s the end of the long path the roninfather and son have been on since the boy’s birth. Through unimaginable violence and bad weather, across hundreds of miles of blood-soaked roadbeds, over years of tragedy and anguish, to this final still-epic story, Itto and Daigoro have kept us holding on to what little hope exists in a world where honor is all but forgotten and warriors are obsolete. It’s a bloody battle all the way to the finish, with dramatic twists and turns right up to the final page. Stay with us as we conclude the translation of what will always be considered one of the finest examples of comic-book mastery ever created, Lone Wolf and Cub. This volume contains the following stories: Corpse Tree Flute and Wave The Lotus Throne Empty Stirrups Arms |
| La Différence invisible | 4.727273 | Delcourt/Mirages | Marguerite a 27 ans, en apparence rien ne la distingue des autres. Elle est jolie, vive et intelligente. Elle travaille dans une grande entreprise et vit en couple. Pourtant, elle est differente. Marguerite se sent decalee et lutte chaque jour pour preserver les apparences. Ses gestes sont immuables, proches de la manie. Son environnement doit etre un cocon. Elle se sent agressee par le bruit et les bavardages incessants de ses collegues. Lassee de cet etat, elle va partir a la rencontre d’elle-meme et decouvrir qu’elle est autiste Asperger. Sa vie va s’en trouver profondement modifiee. |
Оценивание рекомендации: теперь попробуем оценить качество рекомендации еще некоторыми способами.
Здесь мы соединим 2 похожих способа оценивания. Для этого выберем рандомно 3ех пользователей, посмотрим на их реальные предпочтения - любимые комиксы, их вселенные, описание, а также предположим, что мы бы хотели получить в качестве рекомендации, будучи на месте данного пользователя. Затем порекомендуем им несколько комиксов и сравним визуально схожесть с истинными значениями и качество рекомендаций.
Для начала получим список из минимум 5 любимых комиксов(их может быть больше, так как могут быть комиксы, оцененные одинаково). Для первого пользователя:
top5_1 = filter(goodread_reviews, user_id == "85b04c6415a88bdc0a48da3df74767b2") %>%
top_n(5, rating) %>% inner_join(goodread_comics, by = "book_id")
goodread_comics %>% filter(goodread_comics$book_id %in% top5_1$book_id) %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| Batman: No Man’s Land, Vol. 1 | DC Comics |
| Batwoman, Vol. 3: World’s Finest | DC Comics |
| Batgirl, Volume 1: Batgirl Rising | DC Comics |
| Transmetropolitan, Vol. 7: Spider’s Thrash (Transmetropolitan, #7) | Vertigo |
| Batwoman: Elegy | DC Comics |
Видно, что пользователь - фанат DC и Бэтмена в частности. Следовательно, ожидаем получить от системы комиксы DС или Вертиго, а так же Бэтмена/Бэтвумен.
То же самое для второго и третьего.
top5_2 = filter(goodread_reviews, user_id == "f8019b36ddc20e8062a4260851a1efe0") %>%
top_n(5, rating) %>% inner_join(goodread_comics, by = "book_id")
goodread_comics %>% filter(goodread_comics$book_id %in% top5_2$book_id) %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| All-Star Superman, Vol. 2 | DC Comics |
| B.P.R.D., Vol. 7: Garden of Souls (B.P.R.D., #7) | Dark Horse |
| B.P.R.D. Hell on Earth, Vol. 3: Russia (B.P.R.D. Hell on Earth, #3) | Dark Horse |
| Amazing Spider-Man, Vol. 1: The Parker Luck | Marvel Comics |
| Harrow County, Vol. 1: Countless Haints | Dark Horse Comics |
| Batgirl, Vol. 2: Family Business | DC Comics |
| The Unwritten, Vol. 8: Orpheus in the Underworld | Vertigo |
| Paper Girls, Vol. 3 (Paper Girls, #3) | Image Comics |
| The Sixth Gun, Vol. 1: Cold Dead Fingers (The Sixth Gun, #1) | Oni Press |
Этот пользователь не имеет любимый тип комиксов или вселенную, но можно заметить, что есть комиксы DC, Dark Horse, их и ожидаем получить в качестве рекомендации.
top5_3 = filter(goodread_reviews, user_id == "d286122fed6ded84ff53993335bfd59c") %>%
top_n(5, rating) %>% inner_join(goodread_comics, by = "book_id")
goodread_comics %>% filter(goodread_comics$book_id %in% top5_3$book_id) %>% head() %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| Batman: Detective Comics, Vol. 1: Rise of the Batmen | DC Comics |
| Jack of Fables, Vol. 4: Americana | Vertigo |
| C.O.W.L. Volume 1: Principles of Power | Image Comics |
| The Joker: Endgame | DC Comics |
| C.O.W.L., Volume 2: The Greater Good | Image Comics |
| Jack of Fables, Vol. 9: The End | Vertigo |
Третий пользователь имеет много одинаково оцененных комиксов. Среди вселенных можно отметить DС и Image Comics. Если смотреть на названия комиксов, то есть несколько комиксов C.O.W.L и Бэтмена.
goodread_comics %>% filter(goodread_comics$book_id %in% top5_1$book_id) %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| Batman: No Man’s Land, Vol. 1 | DC Comics |
| Batwoman, Vol. 3: World’s Finest | DC Comics |
| Batgirl, Volume 1: Batgirl Rising | DC Comics |
| Transmetropolitan, Vol. 7: Spider’s Thrash (Transmetropolitan, #7) | Vertigo |
| Batwoman: Elegy | DC Comics |
comics_function_CF("85b04c6415a88bdc0a48da3df74767b2", 5)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| The Metamorphosis | 3.200000 | Broadway Books | |
| Only the Ring Finger Knows | 3.384615 | Digital Manga Publishing | It’s the ultimate expression of love - to wear matching rings with your significant other, showing the world that you are a couple. High school student, Wataru Fujii, also wears one though he is single. When he accidentally switches rings with popular and handsome senior, Yuichi Kazuki, they discover that their rings pair up! Since then, Kazuki, who is known for being kind to all becomes strangely harsh to Wataru. They alternate between hot and cold, as in between clashes they begin to sort their feelings for one another. Are Wataru and Kazuki the worst of enemies or are they actually soulmates? Already a popular genre in Japan, especially among females, Yaoi, also known as the “Boy’s Love” genre, is becoming a rising phenomenon in North America. As one of the top titles of its genre in Japan, Only The Ring Finger Knows, will sure to engage readers to a world of intimacy and unique emotion that is solely yaoi manga. |
| Anne Rice’s The Vampire Lestat: A Graphic Novel | 3.923077 | Ballantine Books | |
| The Compleat Moonshadow | 3.650000 | Vertigo | by J.M. DeMatteis & Jon J. Muth Collecting both the original run of Moonshadow and its sequel, Farewell Moonshadow in a single paperback volume. Journey from the farther reaches of outer space to the starry skies of the inner spirit as the young dreamer, Moonshadow, and his cynical alien companion, ira, set forth on the unforgettable intergalactic odyssey that science-fiction great Ray Bradbury called beautiful, original, haunting. Mature Readers. SC, 7x10, 464pg., FC |
| Akira, Vol. 4 | 4.111111 | Dark Horse | The science fiction tale set in 2019 in Tokyo after the city was destroyed by World War III, follows the lives of two teenage friends, Tetsuo and Kaneda, who have a consuming fear of a monstrous power known as Akira. |
По этому пользователю результат - рекомендация не очень хорошая, почти нет совпадений ни по названиям, ни по вселенным.
goodread_comics %>% filter(goodread_comics$book_id %in% top5_2$book_id) %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| All-Star Superman, Vol. 2 | DC Comics |
| B.P.R.D., Vol. 7: Garden of Souls (B.P.R.D., #7) | Dark Horse |
| B.P.R.D. Hell on Earth, Vol. 3: Russia (B.P.R.D. Hell on Earth, #3) | Dark Horse |
| Amazing Spider-Man, Vol. 1: The Parker Luck | Marvel Comics |
| Harrow County, Vol. 1: Countless Haints | Dark Horse Comics |
| Batgirl, Vol. 2: Family Business | DC Comics |
| The Unwritten, Vol. 8: Orpheus in the Underworld | Vertigo |
| Paper Girls, Vol. 3 (Paper Girls, #3) | Image Comics |
| The Sixth Gun, Vol. 1: Cold Dead Fingers (The Sixth Gun, #1) | Oni Press |
comics_function_CF("f8019b36ddc20e8062a4260851a1efe0", 5)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Transmetropolitan, Vol. 7: Spider’s Thrash (Transmetropolitan, #7) | 4.148148 | Vertigo | The hammer has come down on him but outlaw journalist Spider Jerusalem has managed to stay one step ahead of his detractors - I.e. the President of the United States and his authoritarian lackeys in publishing and law enforcement. After losing his byline, bank account, and apartment, Jerusalem and his Filthy Assistants have legged it underground, the better to implement his plan. What plan, you say? Why, the plan to bring down the President of course! |
| House of M | 3.780000 | Marvel | The Marvel event of the decade is here! The Avengers and the X-Men are faced with a common foe that becomes their greatest threat: Wanda Maximoff! The Scarlet Witch is out of control, and the fate of the entire world is in her hands. Will Magneto help his daughter or use her powers to his own benefit? Starring the Astonishing X-Men and the New Avengers! You know how sometimes you hear the phrase: and nothing will ever be the same again? Well, this time believe it, buster! Nothing will ever be the same again! Collecting: House of M1-8 & Pulse: House of MSpecial Edition Newspaper |
| New X-Men, Volume 5: Assault on Weapon Plus | 3.454546 | Marvel | More secrets of the world’s deadliest mutant are exposed! Wolverine, Cyclops and the enigmatic Fantomex travel to the other side of the world and beyond in search of the keys to their pasts. However, what they find within the deadly Weapon Plus program may be more frightening than their worst nightmares. Collecting: Collecting139-145 |
| Vampire Knight, Vol. 1 (Vampire Knight, #1) | 3.640000 | VIZ Media | Yuki Cross has no memory of her past prior to the moment she was saved from a vampire attack ten years ago. She was adopted by the headmaster of Cross Academy, and now works alongside Zero to guard the Academy’s secret. Cross Adademy is attended by two groups of students: the Day Class and the Night Class. At twilight, when the students of the Day Class return to their dorm, they cross paths with the Night Class on their way to school. Yuki Cross and Zero Kiryu are the Guardians of the school, protecting the Day Class from the Academy’s dark secret: the Night Class is full of vampires! |
| Girls: Conception (Girls, #1) | 3.250000 | Image Comics | Ethan Daniels is a typical bachelor who suffers from one, infallible truth: dealing with the opposite sex can be complicated. One night, he bumps into a mysterious woman who will change his life… and maybe even the world. |
Здесь результат получше: странным выглядит только 4-ая рекомендация, так как ни похожих названий, ни вселенной в предпочтениях пользователя нет. В остальном, мы так же рекомендуем ему Марвел(по типу комиксов Марвел схож с DC) и Vertigo, и другой комикс Girls от Image Comics, в этих показателях рекомендация удачна, то есть ожидания оправданы. Проверим последнего пользователя.
goodread_comics %>% filter(goodread_comics$book_id %in% top5_3$book_id) %>% head() %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| Batman: Detective Comics, Vol. 1: Rise of the Batmen | DC Comics |
| Jack of Fables, Vol. 4: Americana | Vertigo |
| C.O.W.L. Volume 1: Principles of Power | Image Comics |
| The Joker: Endgame | DC Comics |
| C.O.W.L., Volume 2: The Greater Good | Image Comics |
| Jack of Fables, Vol. 9: The End | Vertigo |
comics_function_CF("d286122fed6ded84ff53993335bfd59c", 5)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Red Hood and the Outlaws, Volume 2: The Starfire | 3.409091 | DC Comics | As if Batman’s former sidekick Jason Todd, now known as the Red Hood, didn’t have enough problems leading the team of outlaws such as Arsenal and Starfire, now his “estranged” brother Red Robin is knocking on his door because The Night of Owlsis here! With Batman in dire need of help, will Red Hood answer the call? And when Jason and the team find out that Starfire is one of the most feared (and dangerous) commanders in all of space, the team will find their adventures taken to the stars and beyond to help decide the fate of the throne of Tamaran. Witness the galactic struggle between Starfire and her sister Blackfire as Red Hood and the Outlaws are caught in the middle of an interstellar war! Collecting: Red Hood and the Outlaws8-14 |
| Smax | 3.600000 | America’s Best Comics | From critically acclaimed ALAN MOORE, creator of WATCHMEN and LEAGUE OF EXTRAORDINARY GENTLEMEN, comes a magical tale of wonder and enchantment. Jeff Smax, a major character in Moore’s enthralling TOP 10 series, must return to his home world after many years on Earth. Accompanied by his fellow Neopolis’s Precinct Ten police officer Robyn Toybox Slinger, Jeff must face a myriad of challenges ranging from cutting through mountainous red tape to go on a quest, doing battle with the most monstrous of all dragons, and adapting to a world where the laws of physics are not only unheard of, they just plain don’t work. Not to mention Jeff’s sister… |
| Kirby: King of Comics | 4.068966 | Harry N. Abrams | |
| Quartier lointain | 4.714286 | Casterman | Homme mur de 40 ans, transporte dans la peau de l’adolescent qu’il etait a 14 ans, Hiroshi continue la redecouverte de son passe. Questionnant sa grand-mere, ses parents, ses amis, il realise tout ce qui lui avait echappe lorsqu’il etait jeune. Et petit a petit, l’annee scolaire avancant, il voit se rapprocher la date fatidique ou son pere disparaitra, pour toujours, sans aucune explication. Peut-il changer son passe ou est-il condamne a le revivre, impuissant ? Et retrouvera-t-il son existence normale, sa femme et ses enfants ? |
| Wonder Woman, Vol. 5: Rise of the Olympian | 3.882353 | When the gods change their plans for man’s world, it’s up to Wonder Woman to protect humanity against an invading army of male warriors and a new adversary called Genocide. An army of Olympians has risen for an all-out assault on war across the globe and only Wonder Woman can stop them in this new title collecting issues #20-27! One particular attack could spell the end of the Department of Metahuman Affairs and end WW’s secret identity of Diana Prince. And Wonder Woman’s life is changed forever when she faces a monster named Genocide who goes toe-to-toe with her… and wins. Written by Gail Simone Art by Aaron Lopresti, Bernard Chang and Matt Ryan Cover by Aaron Lopresti. |
Здесь качество рекомендации среднее. “Попаданием” можно считать первый комикс(комикс про Джейсона Тодда и Бэтмена) и последний(комикс про Чудо-Женщину).
После оценивания первой рекомендательной системы можно сделать следующий вывод: система работает “средне”, при проверке рекомендации на 3-ех пользователях качество было оценено, как плохое-среднее-хорошее, то есть у всех трех пользоватлелей качество было разное. В целом, система может рекомендовать комиксы читателям.
Теперь перейдем ко второй системе - content-based.
Для начала уберём из датасета лишние переменные.
goodread_comics2 = goodread_comics %>% dplyr::select( book_id, average_rating, publication_year, marvel, dc, image_comics, sent, topic, rating)
В рекомендательной системе мы будем использовать: * Средний рейтинг с сайта * Год публикации * Принадлежность к одной из трёх крупных вселенных (издательств) * Результаты sentiment-анализа * Выделенные LDA темы * Средний рейтинг посчитанный на данных из датасета с отзывами
Сохраняем ID книг в названиях строк и убираем ID из датасета. Меняем тип оставшихся переменных на numeric и считаем косинусное расстояние. Не забываем заменить диагональ в матрице на нули.
goodread_comics2 = goodread_comics2 %>% column_to_rownames(., var = "book_id")
goodread_comics2$average_rating <- as.numeric(goodread_comics2$average_rating )
goodread_comics2$publication_year <- as.numeric(goodread_comics2$publication_year )
simcb = lsa::cosine(t(as.matrix(goodread_comics2)))
diag(simcb) = 0
Теперь посмотрим один пример рекомендации.
Берём id случайного пользователя, ищем книги, которые он оценил на 5 и находим самую похожую на них.
#load("~/shared/minor2_2020/data/good_read/reviews_g_3.RData")
usercb = goodread_reviews %>% filter(user_id == "85b04c6415a88bdc0a48da3df74767b2" & rating == 5)
usercb %>%
select(book_id, user_id, rating) #выводит список комиксов, которые он оценил на 5
## # A tibble: 5 x 3
## book_id user_id rating
## <dbl> <chr> <dbl>
## 1 22426 85b04c6415a88bdc0a48da3df74767b2 5
## 2 137894 85b04c6415a88bdc0a48da3df74767b2 5
## 3 6911529 85b04c6415a88bdc0a48da3df74767b2 5
## 4 7178694 85b04c6415a88bdc0a48da3df74767b2 5
## 5 17671930 85b04c6415a88bdc0a48da3df74767b2 5
simCutcb = simcb[,as.character(usercb$book_id)]
mostSimilarcb = max(simCutcb, na.rm = T)
b = which(simCutcb == mostSimilarcb, arr.ind = TRUE)
#b
result = rownames(b)
filter(goodread_comics,book_id %in% result) %>% dplyr::select(title)%>% kbl() %>% kable_styling()
| title |
|---|
| Batman, Volume 4: Zero Year: Secret City |
А можем этому же пользователю порекомендовать не один комикс, а например 6.
mostSimilarcb = head(sort(simCutcb, decreasing = T), n = 6)
mostSimilarcb
## [1] 1 1 1 1 1 1
b = which(simCutcb %in% mostSimilarcb, arr.ind = TRUE, useNames = T)
index = arrayInd(b, .dim = dim(simcb))
#index
#index[,1]
# id комиксов
result = rownames(simcb)[index[,1]]
# result содержит id рекомендуемых книг
filter(goodread_comics,book_id %in% result) %>% dplyr::select(title, book_id)%>% kbl() %>% kable_styling()
| title | book_id |
|---|---|
| Batman: No Man’s Land, Vol. 1 | 137894 |
| Superman: American Alien | 26152411 |
| Batman, Volume 4: Zero Year: Secret City | 18339834 |
| Batgirl, Volume 1: Batgirl Rising | 7178694 |
| Batman and Robin, Volume 3: Death of the Family | 17671947 |
| American Vampire, Vol. 3 | 12153951 |
Так как каждый раз вручную менять пользователя неудобно, все это можно обернуть в фунцкии. Для этой системы будет написано 2 функции: одна работает с id пользователя, другая непосредственно с комиксом. Было принято решение написать вторую функцию, так как это позволит новым пользователям(как и старым) получить рекомендацию, несмотря на то что их нет в базе данных. Каждая функции будет отличаться входными данными.
user_function = function(n_comics, id){
if (missing(id)) {
rec = goodread_comics %>% arrange(-rating)%>% top_n(n_comics) %>% select(title, rating, publisher, description)
rec = knitr::kable(rec, col.names = c("Попробуйте эти комиксы!", "Средняя оценка", "Вселенная", "Описание")) %>% kable_styling()
} else{
user = goodread_reviews %>% filter(user_id == id) %>% arrange(-rating) %>% top_n(n = 5, wt = rating)
simCut = simcb[,as.character(user$book_id)]
mostSimilar = head(sort(simCut, decreasing = T), n = n_comics)
a = which(simCut %in% mostSimilar, arr.ind = TRUE, useNames = T)
index = arrayInd(a, .dim = dim(simcb))
result = rownames(simcb)[index[,1]]
mostSimilar = data.frame("book_id" = as.numeric(result),
"similar" = simCut[index])
rec = mostSimilar %>% left_join(goodread_comics) %>% select(book_id, title, similar, average_rating, publisher, description) %>% arrange(-similar) %>%select(-similar, -book_id)
rec = knitr::kable(rec %>% distinct(), col.names = c("Рекомендуемый комикс", "Средняя оценка", "Вселенная", "Описание")) %>% kable_styling()
}
rec
}
Вводные данные: количество комиксов, которое пользователь хочет получить в качестве рекомендации, пользовательский id, если его нет- нужно заполнить только первый параметр.
Так как не у каждого пользователя есть оценки 5, мы заменили это списком из 5-ти самых высокорейтинговых комиксов для конкретного пользователя.
На выходе пользователь получает количество комиксов в качестве рекомендации, их средняя оценка, вселенная и описание.
Предыдущий пункт актуален для существующего пользователя, новому мы рекомендуем N наиболее рейтинговых комиксов с тем же набором информации.
user_function(2, "85b04c6415a88bdc0a48da3df74767b2")
| Рекомендуемый комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Batman, Volume 4: Zero Year: Secret City | 4.09 | DC Comics | The New 52 origin of The Dark Knight delves into Bruce Wayne’s past with the Red Hood Gang and his run-ins with aspiring District Attorney Harvey Dent! You won’t want to miss the moment that Bruce becomes Batman! Collecting: Batman#21-24, Batman Zero Year: The Director’s Cut #1 |
| Superman: American Alien | 4.24 | DC Comics | Screenwriter and Eisner Award nominee Max Landis (Chronicle, American Ultra, ADVENTURES OF SUPERMAN) presents the seven-issue miniseries that chronicles Clark Kent’s development into the archetypal hero he will eventually become. With the tone of each issue ranging from heartwarming and simple, to frighteningly gritty and violent, to sexy, sun-kissed and funny, SUPERMAN: AMERICAN ALIEN is unlike anything you’ve seen before. This new hardcover includes special bonus features. |
user_function(1)
| Попробуйте эти комиксы! | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Lone Wolf and Cub, Vol. 28: The Lotus Throne | 4.9 | Dark Horse Manga | What exactly needs to be said in solicitation copy for the VERY LAST VOLUME OF LONE WOLF AND CUB? It’s the moment you’ve all been waiting years and years to read. It’s the end of the long path the roninfather and son have been on since the boy’s birth. Through unimaginable violence and bad weather, across hundreds of miles of blood-soaked roadbeds, over years of tragedy and anguish, to this final still-epic story, Itto and Daigoro have kept us holding on to what little hope exists in a world where honor is all but forgotten and warriors are obsolete. It’s a bloody battle all the way to the finish, with dramatic twists and turns right up to the final page. Stay with us as we conclude the translation of what will always be considered one of the finest examples of comic-book mastery ever created, Lone Wolf and Cub. This volume contains the following stories: Corpse Tree Flute and Wave The Lotus Throne Empty Stirrups Arms |
comics_function = function(comics_name, n_comics){
id = goodread_comics %>% filter(title == comics_name) %>% select(book_id)
if(nrow(id) == 0){
recommend = "Такого комикса нет, пожалуйста,попробуйте ввести другой!"
} else{
mostSimilar = head(sort(simcb[,as.character(id)], decreasing = T), n = n_comics)
mostSimilar = data.frame(similar = mostSimilar)
mostSimilar$book_id = as.numeric(rownames(mostSimilar))
recommend = mostSimilar %>% left_join(goodread_comics) %>% select(book_id, title, similar, rating, publisher, description) %>% arrange(-similar) %>% select(title, rating, publisher, description)
recommend = knitr::kable(recommend, col.names = c("Похожий комикс", "Средняя оценка","Вселенная", "Описание")) %>% kable_styling()
}
recommend
}
Вводные данные: количество комиксов, которое пользователь хочет получить в качестве рекомендации, название комикса, на основе которого будет рекомендация
Если такого комикса нет, будет появляться соответсвующее сообщение.
На выходе пользователь получает количество комиксов в качестве рекомендации, их средняя оценка, вселенная и описание.
Предыдущий пункт актуален как для существующего пользователя, так и для нового.
comics_function("House of M", 2)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Darth Vader #1 | 3.812500 | Marvel | Ever since Darth Vader made his first on-screen appearance, he became one of the most popular villains to ever haunt an audience’s dreams! Now, follow Vader straight from the ending of “Star Wars: A New Hope”, (and the pages of the new Star Wars comic book), into his own series, showing the Empire’s war with the Rebel Alliance from the other side! Writer Kieron Gillen and artist Salvador Larocca bring us a peek behind the mask of evil! |
| New Avengers, Volume 1: Everything Dies | 3.590909 | Marvel | To prevent the collision of our universe with another, the Illuminati must reassemble…NOW! It’s the most powerful and brilliant team in the Marvel Universe: the Black Panther, Iron Man, Doctor Strange, Black Bolt, Mister Fantastic, Namor the Sub-Mariner and the Beast against an infinite legion of parallel realities. Armed with the six Infinity Gems, the Illuminati gather to plan for the death of everything…but their task is complicated by old wounds, lies and secret agendas. But when the Illuminati experience their first dimensional incursion, can this loose brotherhood of end times trust each other enough to use the Infinity Gems in unison? And what new member will join the group? Jonathan Hickman and Steve Epting revamp The New Avengersin a multiverse-spanning saga! Collecting: New Avengers1-6 |
comics_function("Путина не выбрали президентом")
## [1] "Такого комикса нет, пожалуйста,попробуйте ввести другой!"
Следующий этап - оценивание качества рекомендаций.
Оценивание рекомендации: для этого использовались внутренняя пользовательская оценка и проверка на адекватность.
Начнем с собственных входных данных. Предположим, мы прочитали какой-то комикс, он нам понравился, и мы хотим прочитать что-то похожее.
В качестве первого примера возьмем комикс про Ходячих Мертвецов и попросим систему порекомендовать нам 4 комикса. В качестве аутпута ожидаем хотя бы несколько комиксов про тех же ходячих мертвецов или комиксы, похожие по описанию на них(если такие вообще имеются).
comics_function("The Walking Dead, Issue #140", 4)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Ten Grand, Vol. 1 | 3.300000 | Image Comics | Ten Grand charts former mob enforcer Joe Fitzgerald’s journey into the world of demonology and the ancient powers that threaten to tear down the pillars of Heaven itself in a new war between the forces of light and dark. Can the man willing to die a thousand deaths so he can be with his love for just a few minutes in-between save the lives of an entire world? Or will this be the end of…well, everything? |
| The Walking Dead, Issue #137 | 3.687500 | Image Comics | A future uncertain. |
| The Walking Dead, Issue #147 | 4.142857 | Image Comics | Out in the open. |
| Death Note, Vol. 5: Whiteout (Death Note, #5) | 3.500000 | VIZ Media LLC | After a week locked up with no one but Ryuk for company, Light is ready to give up his Death Note and all memories of it. Freed from his past actions, Light is convinced he’s innocent. But L is ready to keep Light under lock and key forever, especially since the killings stopped once Light was incarcerated. Then a new wave of Kira crimes hits Japan. Someone else has gotten their hands on a Death Note, and these new deaths aren’t focused on making the world a better place, they’re focused on making money. Big business can be murder, and Kira has gone corporate! |
Получили ожидаемый в данном случае результат. В качестве рекомендации к ХМ система возвращает нам другие части Ходячих, что довольно логично. Однако это всего лишь 1 пример, попробуем другой комикс.
Та же логика, но для Мстителей. Что будет, если мы - фанаты комиксов про Мстителей и хотим получить рекомендации? Ожидаем получить что-то от Марвел как минимум.
comics_function("The New Avengers, Volume 2", 4)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Oz: The Wonderful Wizard of Oz | 3.909091 | Marvel | The premier American fantasy adventure gets the Merry Marvel treatment! Eisner Award-winning writer/artist Eric Shanower (Age of Bronze) teams up with fan-favorite artist Skottie Young (New X-Men) to bring L. Frank Baum’s beloved classic to life! When Kansas farm girl Dorothy flies away to the magical Land of Oz, she fatally flattens a Wicket Witch, liberates a Scarecrow and is hailed by the Munchkin people as a great sorceress…but all she really wants to know is: how does she get home? COLLECTING: The Wonderful Wizard of Oz #1-8 |
| Moon Knight, by Brian Michael Bendis & Alex Maleev, Volume 1 | 3.703704 | Marvel | The wait is over! Moon Knight is here…like you’ve never seen him before! And we mean never! The Eisner award-winning team of Bendis and Maleev tear into the mythos of Moon Knight with the same verve and derringdo they brought to Daredevil. A Marvelousreinterpretation of one of the most enigmatic characters in Marvel history starts right here! Collecting: Moon Knight1-7 |
| X-23: Innocence Lost | 4.290323 | Marvel | Now it can be told. The full story behind the origin of X-23 - who she is, where she came from and the exact nature of her relationship to Wolverine. You think you know, but you have no idea. Collects X-23 #1-6. |
| Winter Soldier, Volume 2: Broken Arrow | 4.277778 | Marvel | Ed Brubaker is reunited with famed artist Michael Lark (Daredevil)! Winter Soldier finds himself on a twisted trail from coast to coast and past to present, chasing the insane man who will become his worst enemy: a villain who knows that Bucky is still alive. In the aftermath of a tragic and savage murder, Winter Soldier and Black Widow’s hunt gets personal! Old enemies resurface with new code names, and nothing will ever be the same. Collecting: Winter Soldier6-9 |
В этот раз комиксы Марвел здесь подобраны хорошо, так как это, например, Люди Х, которые похожи на Мстителей “командой”. Проверим еще один комикс.
Допустим, пользователь - любитель комиксов про Женщину-Кошку. В этот раз ожидаем получить что-то из Марвел, в частности комиксы про Человека Паука.
comics_function("Spider-Women",4)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| The Thanos Imperative | 4.040000 | Marvel | Thanos is back! A war has ignited which will combine the galaxy’s most dedicated warriors with a collection of heroes that you never saw coming! It’s a battle that will span the cosmos, deliver major shocks, and will prove to you why “Ain’t It Cool News” raves that Abnett and Lanning consistently deliver “terrific action, interesting character development, and some pretty good jokes all rolled into one amazing package”. Collecting: The Thanos Imperative1-6, Ignition; ThanosSourcebook |
| Wolverine and the X-Men, Volume 5 | 3.416667 | Marvel | The next era of the most talked-about new X-book starts here! One of the students is at death’s door, and the faculty must try to keep them alive…and find who did it! Plus, it’s fresh faces aplenty as a new student enrolls - and Storm joins the faculty! Then: Wolverine is a clown? Iceman is a fire swallower? Rachel Grey is a fortune teller? Frankenstein’s Murder Circus has come to town and he’s brainwashed the X-Men! Do the students stand a chance against their teachers? Find out as the Murder Circus claims its victims! All this…and the world’s most awkward date night?! Collecting: Wolverine and the X-Men19-24 |
| Silk #1 | 3.866667 | Marvel Comics | Cindy Moon exploded out of her bunker and into the Marvel Universe when we first learned that she had been bitten by that same radioactive spider in the first arc of AMAZING SPIDER-MAN. She then went on to save Peter Parker’s life (more than once!) and traverse the Spider-verse alongside Spider-Woman. Now, as SILK, Cindy is on her own in New York City, searching for her past, defining her own future, and webbing up wrong-doers along the way! |
| Ultimate Spider-Man, Volume 5: Public Scrutiny | 3.250000 | Marvel | Spider-Man beat Kraven. He defeated Doctor Octopus. He even survived an encounter with a seriously enhanced Green Goblin. As it turns out, though, his worst enemy is a simple crook in a Spider-Man suit. That’s all it took to ruin Spider-Man’s reputation, suddenly making him Public Enemy Number One. When Peter sets out to take back his identity, some things happen that irrevocably change his life forever. Collecting: Ultimate Spider-Man28-32 |
В этот раз система так же рекомендует комиксы нужной вселенной, а так же конкретно Человека-Паука. То есть рекомендацию можно назвать удачной.
Вывод: данный способ оценивания системы показал, что в целом, система работает неплохо, ищет логичные закономерности, однако так же и ошибается, что понятно, так как в базе имеет лишь 500 комиксов. Попробуем еще способ оценить системы.
Теперь вернемся к юзерам и их предпочтениям. Посмотрим на рекомендации некоторым пользователям и сравним их с “настоящими” предпочтениями.
Возьмем рандомного пользователя, найдем его 5 любимых комиксов, их названия и вселенную.
top5_1 = filter(goodread_reviews, user_id == "85b04c6415a88bdc0a48da3df74767b2") %>%
top_n(5, rating) %>% inner_join(goodread_comics, by = "book_id")
goodread_comics %>% filter(goodread_comics$book_id %in% top5_1$book_id) %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| Batman: No Man’s Land, Vol. 1 | DC Comics |
| Batwoman, Vol. 3: World’s Finest | DC Comics |
| Batgirl, Volume 1: Batgirl Rising | DC Comics |
| Transmetropolitan, Vol. 7: Spider’s Thrash (Transmetropolitan, #7) | Vertigo |
| Batwoman: Elegy | DC Comics |
Сравним с рекомендацией.
user_function(5, "85b04c6415a88bdc0a48da3df74767b2")
| Рекомендуемый комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Batman, Volume 4: Zero Year: Secret City | 4.09 | DC Comics | The New 52 origin of The Dark Knight delves into Bruce Wayne’s past with the Red Hood Gang and his run-ins with aspiring District Attorney Harvey Dent! You won’t want to miss the moment that Bruce becomes Batman! Collecting: Batman#21-24, Batman Zero Year: The Director’s Cut #1 |
| Superman: American Alien | 4.24 | DC Comics | Screenwriter and Eisner Award nominee Max Landis (Chronicle, American Ultra, ADVENTURES OF SUPERMAN) presents the seven-issue miniseries that chronicles Clark Kent’s development into the archetypal hero he will eventually become. With the tone of each issue ranging from heartwarming and simple, to frighteningly gritty and violent, to sexy, sun-kissed and funny, SUPERMAN: AMERICAN ALIEN is unlike anything you’ve seen before. This new hardcover includes special bonus features. |
| Batman and Robin, Volume 3: Death of the Family | 4.04 | DC Comics | A direct tie to Scott Snyder and Greg Capullo’s Batman, Volume 3: Death in the Family, comes the disturbingly creepy and psychological thriller of Batman and Robin by the all star team of Peter Tomasi and Patrick Gleason. The Joker returns to test Batman and the extended Bat-family but when he squares off against Batman’s son Damian aka Robin! With Batman’s life hanging in the balance, The Clown Prince of Crime pushes Robin to his limits and beyond. And with the 300th anniversary of the founding of Gotham approaches, tragedy strikes the Bat-family. Collecting: Batman and Robin15-17, Annual 1; Batman17 |
| American Vampire, Vol. 3 | 4.15 | Vertigo | Two epic World War II tales in one massive volume! In the Pacific, Pearl’s husband Henry joins a clandestine group on a secret mission to Japan to hunt a new breed of bloodsucker. Meanwhile, Skinner Sweet has plans of his own… And in Europe, vampire hunters Felicia Book and Cash McCogan go behind enemy lines in Nazi-occupied Romania in search of a rumored vampire cure. Blood and bullets abound in this new collection from the Eisner Award-winning series! Collecting: American Vampire12-18, American Vampire: Survival of the Fittest1-5 |
| Batgirl, Volume 1: Batgirl Rising | 4.18 | DC Comics | In the wake of “Batman R.I.P.”and BATTLE FOR THE COWL, Stephanie Brown, the vigilante formerly known as The Spoiler and Robin has taken on the identity of Batgirl as she begins her nocturnal crusade to take back the night from the underworld. Now she has become the target of both Gotham City’s heroes (who don’t take kindly to a new person wearing the cape and the cowl) and its villains (who want to see the entire Bat-family six feet under). |
| Batman: No Man’s Land, Vol. 1 | 4.11 | DC Comics | Fans of Batman are lucky to get Greg Rucka–the talented, gritty young author of Keeperand Finder, among others–sharing time with their favorite licensed character in this novelization of DC’s complete No Man’s Land comic series. (And fans of Rucka–assuming they get around to reading this at all–will still likely hold the opinion that Atticus Kodiak could take Batman in a standup fight any day.)DC shook up Gotham–literally–in its 1999 Batman plot arc: a 7.6 earthquake rocked Gotham City, wreaking enough destruction to bring the broken, crime-ridden, runt kid-brother of Metropolis and New York to its knees. In the story line’s most indulgent liberty, those fat cats in Washington decide to write off Gotham, a la Escape from New York, blowing up the connecting bridges, mining the surrounding waterways, and signing into law the Federal Declaration of No Man’s Land, which makes it a crime to even set foot in the city. The usual suspects from Arkham Asylum, Two-Face and the Penguin, the Riddler and Dr. Freeze, Poison Ivy and Mr. Zsasz, file out to begin running the show, strong-arming and manipulating the block-by-block turf battles that envelop the now-ultraviolent city. A conflicted Batman shows up fashionably late, only to find that these lunatics are the least of his worries: Lex Luthor, Superman’s archfoe, has nefarious designs on Gotham too. Could this possibly get any better? Sure, No Man’s Landis derivative fiction, but the appeal of Rucka–and, of course, Batman–can make this one worth the read. –Paul Hughes Collecting BATMAN: NO MAN’S LAND #1, BATMAN #563-564, BATMAN: SHADOW OF THE BAT #83-84, DETECTIVE COMICS #730-731 and BATMAN: LEGENDS OF THE DARK KNIGHT #116. |
Рекомендации хорошие. Четкое совпадение по вселенным(DC и Вертиго), а так же рекомендация конкретно Бэтмена, Бэтгерл и Супермена(последние 2 напрямую связаны с первым).
Еще один пользователь:
top5_2 = filter(goodread_reviews, user_id == "f8019b36ddc20e8062a4260851a1efe0") %>%
top_n(5, rating) %>% inner_join(goodread_comics, by = "book_id")
goodread_comics %>% filter(goodread_comics$book_id %in% top5_2$book_id) %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| All-Star Superman, Vol. 2 | DC Comics |
| B.P.R.D., Vol. 7: Garden of Souls (B.P.R.D., #7) | Dark Horse |
| B.P.R.D. Hell on Earth, Vol. 3: Russia (B.P.R.D. Hell on Earth, #3) | Dark Horse |
| Amazing Spider-Man, Vol. 1: The Parker Luck | Marvel Comics |
| Harrow County, Vol. 1: Countless Haints | Dark Horse Comics |
| Batgirl, Vol. 2: Family Business | DC Comics |
| The Unwritten, Vol. 8: Orpheus in the Underworld | Vertigo |
| Paper Girls, Vol. 3 (Paper Girls, #3) | Image Comics |
| The Sixth Gun, Vol. 1: Cold Dead Fingers (The Sixth Gun, #1) | Oni Press |
Видно, что любимые серии для этого пользователя - B.P.R.D, а вселенная Dark Horse, а так же DC Comics, сами комиксы все разные, закономерности не видно. Смотрим на рекомендации.
user_function(5, "f8019b36ddc20e8062a4260851a1efe0")
| Рекомендуемый комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| X-Men Legacy, Volume 2: Invasive Exotics | 3.85 | Marvel | Refusing Wolverine’s offer to join the X-Men, David Haller must now decide how he will carry out his father’s legacy. But upon venturing into the world on his own, will he be beckoned back to Westchester by his budding fascination with young X-Man Blindfold? And more importantly: how will their future together change the fate of mutantkind? Legion and Blindfold go on a date…to the moon! But when Legion reveals his ulterior motive for visiting the moon, will Blindfold leave him without a goodnight kiss? Plus: desperate to learn if the predictions of his destroying mutantkind are true, Legion makes a deal with the devil in his own mind to find answers. Collecting: X-Men Legacy 7-12 |
| The Middleman: The Doomsday Armageddon Apocalypse | 4.35 | Viper Comics | The Middleman and Wendy return in a new adventure that completes the epic journey of their hit tv show! A betrayal by one of Wendy’s closest friends sets off a chain of events that threatens the very fabric of human existence. Alone and surrounded by the forces of FATBOY and their leader, the dreaded Manservant Neville, Wendy and The Middleman stare down the barrel of a sacrifice so ultimate it will shake the Middleman universe to its very foundation! Based on the lost series script by creator Javier Grillo-Marxuach and co-executive producer Hans Beimler. |
| American Vampire, Vol. 6 | 3.74 | Vertigo | You are cordially invited to a party–to die for! This volume of American Vampire collects eight amazing stories set in the world of American Vampire, with “lost tales,” new characters and old favorites. Don’t miss these stories brought to you by series creators Scott Snyder and Rafael Albuquerque, as well as other awesome comics talent like Becky Cloonan (Batman), Gabriel Ba and Fabio Moon (Daytripper), Jeff Lemire (i>Sweet Tooth), Greg Rucka (The Punisher, Batwoman), Gail Simone (Batgirl) and many more! Also collected here is the stand alone tale of Fan-favorite character Travis Kidd–the vampire hunter who likes to “bite them back”. Collecting: American VampireAnthology, The Long Road to Hell |
| The Wicked + The Divine 1831 | 3.88 | Image Comics | “MODERN ROMANCE” Critically-acclaimed THE WICKED + THE DIVINE goes back to the nineteenth century, to see what became of the Romantic poets one infamous night on Lake Geneva… |
| Avengers, Volume 1: Avengers World | 3.80 | Marvel | The greatest heroes in comics together on one unbeatable team! The Avengers “go large,” expanding their roster and their sphere of influence to a global and even interplanetary level. When Captain America puts out his call - who will answer? Big threats, big ideas, big idealism - these are the Avengers NOW! Collecting: Avengers1-6 |
Здесь рекомендация сработала относительно не очень.Неточное попадание и по вселенным, и по конкретным комиксам. И проверим еще одного пользователя.
top5_3 = filter(goodread_reviews, user_id == "d286122fed6ded84ff53993335bfd59c") %>%
top_n(5, rating) %>% inner_join(goodread_comics, by = "book_id")
goodread_comics %>% filter(goodread_comics$book_id %in% top5_3$book_id) %>% head() %>% select(title, publisher)%>% kbl() %>% kable_styling()
| title | publisher |
|---|---|
| Batman: Detective Comics, Vol. 1: Rise of the Batmen | DC Comics |
| Jack of Fables, Vol. 4: Americana | Vertigo |
| C.O.W.L. Volume 1: Principles of Power | Image Comics |
| The Joker: Endgame | DC Comics |
| C.O.W.L., Volume 2: The Greater Good | Image Comics |
| Jack of Fables, Vol. 9: The End | Vertigo |
Опять попались на фаната DC и Vertigo. Любимые комиксы зачастую - Бэтмен, C.O.W.L, Jack of Fables.
user_function(5, "d286122fed6ded84ff53993335bfd59c")
| Рекомендуемый комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| American Vampire, Vol. 6 | 3.74 | Vertigo | You are cordially invited to a party–to die for! This volume of American Vampire collects eight amazing stories set in the world of American Vampire, with “lost tales,” new characters and old favorites. Don’t miss these stories brought to you by series creators Scott Snyder and Rafael Albuquerque, as well as other awesome comics talent like Becky Cloonan (Batman), Gabriel Ba and Fabio Moon (Daytripper), Jeff Lemire (i>Sweet Tooth), Greg Rucka (The Punisher, Batwoman), Gail Simone (Batgirl) and many more! Also collected here is the stand alone tale of Fan-favorite character Travis Kidd–the vampire hunter who likes to “bite them back”. Collecting: American VampireAnthology, The Long Road to Hell |
| Angel: After the Fall, Volume 1 | 3.76 | IDW Publishing | In Angel’s final television season, his world ended… but his story didn’t. Picking up where Season Five of the fan-favorite TV show left off, this first collection looks at who lived after that climactic battle, who died, and what happened to all of Los Angeles in its wake. |
| Americus | 3.79 | First Second | Neal Barton just wants to read in peace. Unluckily for him, some local Christian activists are trying to get his favorite fantasy series banned from the Americus public library on grounds of immoral content and heresy. Something has to be done, and it looks like quiet, shy Neal is going to have to do it. With youth services librarian Charlotte Murphy at his back, Neal finds himself leading the charge to defend the mega-bestselling fantasy series that makes his life worth living. This funny, gripping, and relatable tale of life and local politics in middle America is currently being serialized online. |
| Batman Incorporated, Volume 2: Gotham’s Most Wanted | 3.90 | DC Comics | Batman and his allies must strengthen their resolve as Leviathan moves against Gotham City. Everything since issue #1 has been leading to the tragic moment in which Damian Wayne pays the ultimate price in the war against crime! Collecting: Batman Incorporated7-13, Special |
| Saga, Vol. 1 (Saga, #1) | 4.24 | Image Comics | When two soldiers from opposite sides of a never-ending galactic war fall in love, they risk everything to bring a fragile new life into a dangerous old universe. From bestselling writer Brian K. Vaughan, Sagais the sweeping tale of one young family fighting to find their place in the worlds. Fantasy and science fiction are wed like never before in this sexy, subversive drama for adults. Collecting: Saga1-6 |
Рекомендации сработали относительно неплохо. Мы рекомендуем этому пользователю Бэтмена, а так же комикс от Image Comics.
В итоге, в 3-ех проверках мы нашли, что в 1 случае рекомендации сработали плохо, в остальных 2ух. - приемлемо или хорошо. Одной из причин, помимо обычной ошибки/недочета, может быть то, что мы мало знаем о самом пользователе. Например, если он оценил пару комиксов, то будет очень сложно попасть “в точку”.
Все рекомендательные системы построены, проверены и оценены. Теперь можем перейти к рассмотрению вопросов и ситуаций, предложенных другими студенами майнора.
Примечание: в силу характера вопросов и ситуаций мы смогли ответить на все из них с помощью одной функции, так как спрашивалось в основном про комиксы(а не пользователей). Однако примеры на обе системы и другие функции Вы можете найти выше после раздела с кодом функции - там есть демонстрация каждого сценария(про нового пользователя, старого итд).
Указанный пример: Мне интересно, получится ли у меня вытащить комиксы DC через введение Marvel-комиксов как моих любимых. Они ведь довольно схожи по всем характеристикам кроме непосредственно издательства.
Ответ: теоретически - да, получится, однако почти всегда при вводе комикса Марвел список будет состоять именно из этой вселенной. Например:
comics_function("Indestructible Hulk, Volume 1: Agent of S.H.I.E.L.D.", 5)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Spider-Woman, Agent of S.W.O.R.D. | 3.555556 | Marvel Comics | The team of Brian Michael Bendis and Alex Maleev return to a Marvel comic for the first time since their Eisner award-winning run on Daredevil. Ripped from the pages of Secret Invasion and New Avengers, this explosive chapter follows the new adventures of Jessica Drew, aka: Spider-Woman, as she rediscovers her life in a world she did not make. Collects Spider-Woman #1-7. |
| All-New X-Men, Volume 1: Yesterday’s X-Men | 3.960000 | Marvel | It’s a blast from the past as the original five students of Professor X - Cyclops, Marvel Girl, Iceman, Angel and Beast - are plucked from the past and brought to the present. But what they find, the state that their future selves are in and the state of Xavier’s dream, is far from the future they dreamed of. And how will the X-Men of the present deal with their past coming crashing forward? Collecting: All-New X-Men1-5 |
| Moon Knight, by Brian Michael Bendis & Alex Maleev, Volume 1 | 3.703704 | Marvel | The wait is over! Moon Knight is here…like you’ve never seen him before! And we mean never! The Eisner award-winning team of Bendis and Maleev tear into the mythos of Moon Knight with the same verve and derringdo they brought to Daredevil. A Marvelousreinterpretation of one of the most enigmatic characters in Marvel history starts right here! Collecting: Moon Knight1-7 |
| Captain America: No Escape | 3.583333 | Marvel Comics | Acclaimed artist Butch Guice joins award-winning writer Ed Brubaker as Zemo returns to finish the job his father started–Killing Bucky! Collecting: Captain America606-610 |
| Ultimate X-Men, Volume 7: Blockbuster | 3.272727 | Marvel | It’s the movie you will never see in theatres as the X-Men, Spider- Man and Daredevil all team up to help Wolverine fight against a secret from his mysterious past. The Ultimate Universe comes to life like never before in this action-packed storyline. Collecting: Ultimate X-Men34-39 |
Или:
comics_function("Wolverine: Origins, Volume 1: Born in Blood", 5)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| War of Kings | 3.357143 | Marvel | The complete War of Kings epic in one colossal collection! In the aftermath of the Secret Invasion, Black Bolt has led the Inhumans on a shockingly savage path to restore their strength and security. But that path has brought them into direct confrontation with the Shi’Ar Empire - and their mad ruler Vulcan! Who will get in the first strike? Who will fall on the bloody battlefield? Who will rule? The Imperial Guard, the Starjammers, the Inhuman Royal Family, and more of your favorite sci-fi characters are locked on a collision course! Collecting: War of Kings1-6, War of Kings: Ascension1-4, War of Kings: Darkhawk1-2, War of Kings: Warriors, War of Kings: Who Will Rule?, War of Kings: Savage World of Sakaar, Marvel SpotlightWar of Kings |
| Guardians of the Galaxy, Volume 1: Cosmic Avengers | 3.640000 | Marvel | There’s a new rule in the galaxy: No one touches Earth! But why has Earth suddenly become the most important planet in the galaxy? That’s what the Guardians of the Galaxy are going to find out! Join Star-Lord, Gamora, Drax, Rocket Raccoon, Groot and–wait for it–the Invincible Iron Man as they embark upon one of the most explosive and eye-opening chapters of Marvel NOW! The secrets these galactic Avengers discover will rattle Marvel readers for years to come! But while London deals with a brutal invasion by the Badoon, the fate of the Guardians may have already been decided millions of miles away! Why wait for the movie? It all starts here! Collecting: Guardians of the Galaxy0.1, 1-3; & Guardians of the GalaxyInfinite Comic |
| Future Imperfect: Warzones! | 3.285714 | Marvel Comics | On Battleworld, the dictator of Dystopia has a familiar face! The bearded Maestro rules with a Gamma fist, but there are those who would dethrone him – among them, Ruby Summers, the daughter of Cyclops and Emma Frost! The Thing is on board, too, but is it the ever-lovin’ Ben Grimm under that rocky hide? Layla Miller could probably tell you – after all, she knows stuff. But can the rebels trust her? To take on the most monstrous Hulk of all, they will need powerful aid – but is that truly Odin they have found? And a mission to Norseheim to retrieve the Destroyer will only lead to battle with Ulik and his army of trolls. This is one warzone deserving of the name. Maestro vs. Thing! Maestro vs. Doom! Maestro vs. everybody! Maestro smash! Collecting FUTURE IMPERFECT #1-5 and material from SECRET WARS: BATTLEWORLD #4. |
| Spider-Man: The Gauntlet Book 1 - Electro & Sandman | 2.600000 | Marvel | The event that redefines Spider-Man’s classic arch-enemies, one by one, starts with one of his deadliest - Electro! Destitute and desperate, conned out of his life’s meaning and worth, Max Dillon becomes the voice of the common man against the brutal injustice of a system overloaded by greed. |
| All-New X-Men, Volume 6: The Ultimate Adventure | 3.513514 | Marvel | Dimension-hopping is something of an X-Men rite of passage, and it’s about time the All-New X-Men took the plunge! You don’t always have to travel Miles away to visit a new place…but will the Web these time-displaced young X-Men find themselves tangled in Ultimately bring about their end? Okay, enough subtlety: the All-New X-Men meet Miles Morales, the Ultimate Spider-Man - and this is a showdown you won’t want to miss! Plus: it’s Iceman unleashed, as young Bobby Drake takes the offensive! And for someone who’s said that she doesn’t find him particularly pleasant to be around, X-23 seems to have taken an odd interest in the high-flying Angel. Tune in as yesterday’s X-Men continue to explore the fear-fraught future of the present day! Collecting: All-New X-Men31-36 |
Как видно из примеров выше - зачастую комиксам Марвел соответствуют другие комиксы Марвел.
Указанный пример: Предположим, я положительно оценил комиксы с Людьми Икс и Черной Пантерой. Отрицательно (т.е. менее 4) я ничего не оценивал. В результате, я бы ожидал от системы, что она мне порекомендует Человека Паука, Фантастическую Четверку или что-нибудь ещё от вселенной Marvel.
Ответ: в случае случайного комикса про Людей Х:
comics_function("X-Men Legacy, Volume 3: Revenants", 5)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| The Mighty Thor, Volume 2: Lords of Midgard | 3.909091 | Marvel | The legend continues with Thors new and old! Loki spins a special ages-old tale of a young Odinson in action against a hulking great enemy. You wouldn’t like this Viking when he’s angry! But what incredible impact will this yarn from the past have on the present? Prepare for corporate espionage, Marvel-style, as some of the world’s most powerful and evil conglomerates go to war – with Thor caught in the middle! But if Roxxon and the rest aren’t enough trouble, Jane Foster must contend with a new enemy: S.H.I.E.L.D.! Whose side will Agent Roz Solomon be on? Worse still, somehow millions of lives will depend on the God of Thunder saving Roxxon’s evil executive, Dario Agger! All this and…the Exterminatrix and the Silver Samurai?! Collecting: The Mighty Thor6-12 |
| Avengers, Volume 1: Avengers World | 3.440000 | Marvel | The greatest heroes in comics together on one unbeatable team! The Avengers “go large,” expanding their roster and their sphere of influence to a global and even interplanetary level. When Captain America puts out his call - who will answer? Big threats, big ideas, big idealism - these are the Avengers NOW! Collecting: Avengers1-6 |
| X-Men Legacy, Volume 2: Invasive Exotics | 3.466667 | Marvel | Refusing Wolverine’s offer to join the X-Men, David Haller must now decide how he will carry out his father’s legacy. But upon venturing into the world on his own, will he be beckoned back to Westchester by his budding fascination with young X-Man Blindfold? And more importantly: how will their future together change the fate of mutantkind? Legion and Blindfold go on a date…to the moon! But when Legion reveals his ulterior motive for visiting the moon, will Blindfold leave him without a goodnight kiss? Plus: desperate to learn if the predictions of his destroying mutantkind are true, Legion makes a deal with the devil in his own mind to find answers. Collecting: X-Men Legacy 7-12 |
| Spider-Man: Dying Wish | 3.588235 | Marvel | The end of Spider-Man’s world begins, when the dying Doctor Octopus discovers who Peter Parker really is! COLLECTING: Amazing Spider -Man (1963) 698-700 |
| Thor, Volume 2: Who Holds the Hammer? | 3.480000 | Marvel | Who is Thor? That’s the question on everyone’s lips. Most especially Prince Odinson of Asgard. This volume, he starts to narrow down the list of suspects. Meanwhile, tensions continue to flare between the All-Mother and All-Father, Malekith forges his most dangerous pact yet, and Thor prepares to face her greatest challenge! Collecting: Thor6-8, Annual |
Все комиксы из Марвел, есть указанный в примере комикс конкретно про человека-паука.
Для Черной Пантеры:
comics_function("Black Panther: World of Wakanda", 5)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| First Blood (Star Wars: Kanan, #2) | 3.703704 | Marvel Comics | Continue to explore the early days of Kanan Jarrus, the sensational star of STAR WARS REBELS! You’ve seen Kanan’s last adventure as a Padawan, now witness his first! The boy who was Caleb Dune must find his feet as the Clone Wars rage all around him. When the Jedi Temple comes under attack, what can a mere Padawan do to make a difference? Caleb and his new master, Bilaba, will take command of their own clone troop, and lead them into the furious Battle of Mygeeto. But lying in wait for them there are a pair of Separatist Generals, one of whom is one of the most deadly threats in the entire galaxy! Can Caleb and Bilaba survive Grievous? Collecting KANAN #7-12. |
| Doctor Who: The Only Good Dalek | 3.352941 | BBC Books | Station 7 is where the Earth Forces send all the equipment captured in their unceasing war against the Daleks. It’s where Dalek technology is analyzed and examined. It’s where the Doctor and Amy have just arrived. But somehow the Daleks have found out about Station 7 - and there’s something there that they want back With the Doctor increasingly worried about the direction the Station’s research is taking, the commander of Station 7 knows he has only one possible, desperate defense. Because the last terrible secret of Station 7 is that they don’t only store captured Dalek technology - it’s also a prison. And the only thing that might stop a Dalek is another Dalek An epic, full-color graphic novel featuring the Doctor and Amy, as played by Matt Smith and Karen Gillan in the spectacular hit series from BBC Television |
| المحاكمة | 3.272727 | dr lshrwq |
<>. fy hdhh lmlj@ l'khdh@ lrwy@ <>krwy@ mSwr@, nqr' lqS@ lky'yb@ ljwzyf k, ldhytql dht SbH dwn ’n tushrH lh l’sbb, lyjd nfsh fy Srmryr Dd jrt qDy'y@ fy Gy@ lGmwD. wyuqdhf bh mn mwjh@ tbth l~ ltshwsh l~ lty tlyh, wmn thamaW ttnm~ bdkhlh mshr lHbT mn ’n ythbt brth fy mwjh@ tuhm mjhwl@. fy lwH@ shdyd@ lwDwH llbyrwqrTy@ lmtslT@ lty tdhs Hy@ mwTnyh lmGraWbyn. wlhdh fn <>mnsb@ lmqtD~ lHl lan mthlm knt dy’man. tHmyl rwy@ lmHkm@ lfrnz kfk mn hdh lrbT http://goo.gl/dZWycA
|
| Avengers, Volume 1: Avengers World | 3.440000 | Marvel | The greatest heroes in comics together on one unbeatable team! The Avengers “go large,” expanding their roster and their sphere of influence to a global and even interplanetary level. When Captain America puts out his call - who will answer? Big threats, big ideas, big idealism - these are the Avengers NOW! Collecting: Avengers1-6 |
| Smax | 3.600000 | America’s Best Comics | From critically acclaimed ALAN MOORE, creator of WATCHMEN and LEAGUE OF EXTRAORDINARY GENTLEMEN, comes a magical tale of wonder and enchantment. Jeff Smax, a major character in Moore’s enthralling TOP 10 series, must return to his home world after many years on Earth. Accompanied by his fellow Neopolis’s Precinct Ten police officer Robyn Toybox Slinger, Jeff must face a myriad of challenges ranging from cutting through mountainous red tape to go on a quest, doing battle with the most monstrous of all dragons, and adapting to a world where the laws of physics are not only unheard of, they just plain don’t work. Not to mention Jeff’s sister… |
Здесь так же есть комиксы от Марвел, но не все. Возможно, это связано с тем, что комиксов(и информации о них) про Пантеру в системе немного, их всего 5. В любом случае, система все равно рекомендует Марвел в том числе.
Указанные примеры: Какую рекомендацию получит пользователь, если в качестве любимого комикса введет “Avatar: The Last Airbender: The Search, Part 1 (The Search, #1)”? Самой первой скорее всего будет вторая часть этого комикса, но какими будут остальные рекомендации?
если в функцию на вход дать какой-либо комикс avatar то какие комиксы порекомендует система? больше мангу или какие нибудь западные fantasy комиксы?
Ответ: давайте посмотрим, что вернет функция с таким комиксом в качестве инпута:
comics_function("Avatar: The Last Airbender: The Search, Part 1 (The Search, #1)", 5)
## [1] "Такого комикса нет, пожалуйста,попробуйте ввести другой!"
Так как наши датасеты немного различаются между группами, указанного студентом комикса у нас нет, но есть похожие по названию, используем их(к слову, выше получилась демонстрация сценария, когда введенного комикса нет в системе). Возьмем комикс Avatar: The Last Airbender: The Search, Part 3 (The Search, #3):
comics_function("Avatar: The Last Airbender: The Rift, Part 1 (The Rift, #1)", 7)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Mushishi, Vol. 2 | 4.214286 | Del Rey | DARK MOUNTAIN Mushi, a terrifying primitive life-form, take countless shapes-most of them deadly to the human race. Enter Ginko, a mushi expert, known as a mushishi. Though his laconic smile and soft-spoken manner don’t seem imposing, he represents the human world’s greatest defense. When a fellow mushishi disappears, Ginko must search for him on a mushi-infested mountain, putting his own life on the line! |
| Pokémon Adventures, Vol. 1 (Pokémon Adventures, #1) | 3.800000 | VIZ Media - Children’s | Adventures based on the best-selling video games! All your favourite Pokemon game characters jump out of the screen into the pages of this action-packed manga! Red doesn’t just want to train Pokemon, he wants to be their friend too. Bulbasaur and Poliwhirl seem game. But independent Pikachu won’t be so easy to win over! And watch out for Team Rocket, Red… They only want to be your enemy! Reads R to L (Japanese Style). |
| Paul Has a Summer Job | 3.909091 | Drawn and Quarterly |
Rabagliatis strip "Paul: Apprentice Typographer" was one of the highlights of 1999s Drawn & Quarterly anthology, and his first comic book Paul in the Countrywon the 2000 Harvey award for Best New Talent. This, his first graphic novel, is eagerly anticipated by comix connoisseurs who enjoy a sweet, unsentimental story about being a teenager and Rabagliati’s crisp retro-modern 1950s drawing style. Paul Has a Summer Jobcontinues the story of Paul, a Quebecois teenager in the 1970s, as he experiences the first conflicts of responsibility with his desire to be free. Paul is outraged that he is forced to stop his high school art training. But he’s been asked to put art aside because his other grades are so terribly low. Defiant, he quits school and anticipates a summer of leisure. But instead Paul follows the path of so many Quebecois teenagers: he lands a job as a counselor at one of the many summer camps in the mountains outside the city. There he finds himself guiding a motley band of kids, misfits and troublemakers, much like himself.
|
| Avatar: The Last Airbender: The Promise, Part 1 (The Promise, #1) | 3.980000 | Dark Horse Comics | The war is over…but the adventure has just begun! Picking up exactly where Avatar: The Last Airbenderleft off. The Promisetakes Aang to a Fire Nation colony in the heart of the Earth Nation, where tensions between neighbors threaten to shatter the world’s newfound peace–putting the Avatar on a collision course with one of his closest friends, Fire Lord Zuko! |
| Excelsior!: The Amazing Life of Stan Lee | 3.900000 | Touchstone | The man behind Spider-Man, The X-Men, The Incredible Hulk, and a legion of other superheroes tells his own amazing story in a book packed with punch, humor, anecdotes, and a gallery of never-before-seen photographs.Stan Lee is the most legendary name in the history of comicbooks. The leading creative force behind the rise of Marvel Comics, he brought to life some of the world’s best-known heroes and most infamous villains. His stories, featuring super- heroes who struggled against personal hang-ups and bad guys who possessed previously unseen psychological complexity, added wit and subtlety to a field previously locked into flat portrayals of good vs. evil. Lee put the human in the super-human. In the process, he created a new mythology for the twentieth century. In this treasure trove of marvelous memories, Stan tells the story of his life with the same inimitable wit, energy, and offbeat spirit that he brought to the world of comicbooks. He moves from his impoverished childhood in Manhattan to his early days writing comicbooks, followed by military training films during World War II, through the rise of the Marvel empire in the 1960s to his recent adventures in Hollywood. The story of a man who earned respect by blazing new creative trails in a storytelling form once dismissed as just for kids, Excelsior!is an inspirational story about following one’s vision, no matter the odds. Yet it’s also the story of how some of the most exciting and memorable characters in the pop-culture universe came to thrill a generation. |
| Nausicaä of the Valley of the Wind: The Complete Series | 4.000000 | VIZ Media LLC | Nausicaa of the Valley of the Wind is an epic fantasy tale written and illustrated by legendary Studio Ghibli director Hayao Miyazaki, creator of My Neighbor Totoro, Spirited Away and Howl’s Moving Castle. A modern masterpiece, the entire series is now available in this deluxe box set containing two hardcover volumes with interior color pages and a bonus poster. |
| The Tiger (Love, #1) | 3.936170 | Magnetic Press | A day in the life of the king of the jungle, this lavishly illustrated story follows a single majestic tiger through a wordless adventure of survival as it hunts prey and defends itself from other would-be killers defending their territory. This exciting tale is told without narration or dialogue, conveyed entirely through the beautiful illustrations of Federico Bertolucci. A beautiful, all-ages title that explores genuine natural behavior through the dramatic lens of Disney-esque storytelling. Like a nature documentary in illustration. |
Здесь система выдала много разных комиксов из разных вселенных(но 3/5 комиксов - манга), но в том числе на 4 месте можно увидеть другой комикс про Аватара.
Ответ на второй вопрос: больше рекомендует комиксы Манга.
Указанные примеры: Любимый комиксы пользователя: “Наруто” и “Моя геройская академия”. Будет ли ему порекомендован комикс “Магическая битва”? Результат: да, будет порекомендован (при наличии в датасете)
Если пользователю нравится манга “Наруто”, ему возможно понравилась бы манга “Блич”
Ответ: к сожалению, комиксов про Наруто в нашем датасете обнаружено не было.
Указанный пример: Какую рекомендацию получит пользователь, который в первые использует данную платформу? Я ожидаю, что они доработают свой проект с учетом вновь прибывших пользователей и сделают функцию для таких случаев.
Ответ: ничего дорабатывать не нужно, в видео было сказано, что все функции(где вводится id) так или иначе приспособлены к новым пользователям. Пример: новый пользователь просто вводит количество желаемых рекомендаций.
user_function(2)
| Попробуйте эти комиксы! | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Lone Wolf and Cub, Vol. 28: The Lotus Throne | 4.900000 | Dark Horse Manga | What exactly needs to be said in solicitation copy for the VERY LAST VOLUME OF LONE WOLF AND CUB? It’s the moment you’ve all been waiting years and years to read. It’s the end of the long path the roninfather and son have been on since the boy’s birth. Through unimaginable violence and bad weather, across hundreds of miles of blood-soaked roadbeds, over years of tragedy and anguish, to this final still-epic story, Itto and Daigoro have kept us holding on to what little hope exists in a world where honor is all but forgotten and warriors are obsolete. It’s a bloody battle all the way to the finish, with dramatic twists and turns right up to the final page. Stay with us as we conclude the translation of what will always be considered one of the finest examples of comic-book mastery ever created, Lone Wolf and Cub. This volume contains the following stories: Corpse Tree Flute and Wave The Lotus Throne Empty Stirrups Arms |
| La Différence invisible | 4.727273 | Delcourt/Mirages | Marguerite a 27 ans, en apparence rien ne la distingue des autres. Elle est jolie, vive et intelligente. Elle travaille dans une grande entreprise et vit en couple. Pourtant, elle est differente. Marguerite se sent decalee et lutte chaque jour pour preserver les apparences. Ses gestes sont immuables, proches de la manie. Son environnement doit etre un cocon. Elle se sent agressee par le bruit et les bavardages incessants de ses collegues. Lassee de cet etat, elle va partir a la rencontre d’elle-meme et decouvrir qu’elle est autiste Asperger. Sa vie va s’en trouver profondement modifiee. |
Или для системы коллаборативной фильтрации:
comics_function_CF("новый пользователь", 1)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Lone Wolf and Cub, Vol. 28: The Lotus Throne | 4.9 | Dark Horse Manga | What exactly needs to be said in solicitation copy for the VERY LAST VOLUME OF LONE WOLF AND CUB? It’s the moment you’ve all been waiting years and years to read. It’s the end of the long path the roninfather and son have been on since the boy’s birth. Through unimaginable violence and bad weather, across hundreds of miles of blood-soaked roadbeds, over years of tragedy and anguish, to this final still-epic story, Itto and Daigoro have kept us holding on to what little hope exists in a world where honor is all but forgotten and warriors are obsolete. It’s a bloody battle all the way to the finish, with dramatic twists and turns right up to the final page. Stay with us as we conclude the translation of what will always be considered one of the finest examples of comic-book mastery ever created, Lone Wolf and Cub. This volume contains the following stories: Corpse Tree Flute and Wave The Lotus Throne Empty Stirrups Arms |
То есть новый пользователь, о котором наша система ничего не знает, получит список из N комиксов с наибольшей средней оценкой.
Указанный пример: По той причине, что у ребят есть такая функция, то я хотел бы проверить content-based систему. Давайте предположим, что мне нравится “Kamisama Kiss Vol.5” и я хочу 3 рекосендации. Исходя из анализа своей функции, я выделил несколько предположений о том, что я ожидаю на выходе: - Kamisama Kiss Vol.N, где N!=5 - Noragami: Stray God #M - Fruits Basket Vol.K где N,M,K - натуральные числа Все эти книги - манга, и было бы странно получить что-то из разряда “Marvel” или “DC”
Ответ: попробуем ввести указанный комикс
comics_function("Kamisama Kiss Vol.5", 1)
## [1] "Такого комикса нет, пожалуйста,попробуйте ввести другой!"
Оказалось, что в системе такого комикса нет. Но у нас есть один комикс про Kamisama Kiss, введем его.
comics_function("Kamisama Kiss, Vol. 9", 3)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| Vampire Knight, Vol. 6 (Vampire Knight, #6) | 3.850000 | VIZ Media LLC | Cross Adademy is attended by two groups of students: the Day Class and the Night Class. At twilight, when the students of the Day Class return to their dorm, they cross paths with the Night Class on their way to school. Yuki Cross and Zero Kiryu are the Guardians of the school, protecting the Day Class from the Academy’s dark secret: the Night Class is full of vampires! Yuki sneaks into an exclusive vampire party and sees Aido’s parents introducing their daughter to Kaname. They, like many other Night Class parents, desire an alliance with the pureblood. Kaname is the most eligible bachelor in the vampire society–but will he choose Yuki? |
| Black Hammer, Vol. 1: Secret Origins | 4.173913 | Dark Horse | Once they were heroes, but the age of heroes has long since passed. Banished from existence by a multiversal crisis, the old champions of Spiral City–Abraham Slam, Golden Gail, Colonel Weird, Madame Dragonfly, and Barbalien–now lead simple lives in an idyllic, timeless farming village from which there is no escape! But as they employ all of their super abilities to free themselves from this strange purgatory, a mysterious stranger works to bring them back into action for one last adventure! Collects Black Hammer #1-#6. The first chapter in Jeff Lemire (The Underwater Welder, The Complete Essex County, Animal Man) and Dean Ormston’s (Lucifer) acclaimed series! |
| Storm Born #2 (Dark Swan Comic, #2) | 4.315790 | Sea Lion Books | Eugenie Markham is a freelance shaman, guarding our world from the invasion of Otherworldly creatures. Those who try have “The Dark Swan” to contend with. But Eugenie’s about to cross into the Otherworld alone to rescue a girl that nobody else will. Will she make it back across alive? |
Во-первых, из указанных 3-трех комиксов, которых студент ожидал в качестве рекомендации, у нас в системе есть только 2(один из них используется в самой функции, так что технически 1), во-вторых, нет, комиксов Марвел и DC получено не было, в-третьих, первый комикс в списке рекомендаций - комикс манга, что и ожидалось получить.
Указанный пример: Что будет, если я захочу получить 3 рекомендации и укажу, что мой любимый комикс “Ходячие Мертвецы”?
Ответ: по случайному совпадению, этот пример был рассмотрен нами в секции оценивания, но все же:
comics_function("The Walking Dead, Issue #15", 3)
| Похожий комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| The Walking Dead, Issue #137 | 3.6875 | Image Comics | A future uncertain. |
| The Walking Dead, Vol. 18: What Comes After | 4.1000 | Image Comics | Following the events of “Something to Fear,” Rick and the other survivors accept a new way…but not everyone agrees. Collects The Walking Dead #103-108. |
| Lone Wolf and Cub, Vol. 28: The Lotus Throne | 4.9000 | Dark Horse Manga | What exactly needs to be said in solicitation copy for the VERY LAST VOLUME OF LONE WOLF AND CUB? It’s the moment you’ve all been waiting years and years to read. It’s the end of the long path the roninfather and son have been on since the boy’s birth. Through unimaginable violence and bad weather, across hundreds of miles of blood-soaked roadbeds, over years of tragedy and anguish, to this final still-epic story, Itto and Daigoro have kept us holding on to what little hope exists in a world where honor is all but forgotten and warriors are obsolete. It’s a bloody battle all the way to the finish, with dramatic twists and turns right up to the final page. Stay with us as we conclude the translation of what will always be considered one of the finest examples of comic-book mastery ever created, Lone Wolf and Cub. This volume contains the following stories: Corpse Tree Flute and Wave The Lotus Throne Empty Stirrups Arms |
Конкретно к 15-ому комиксу WD система рекомендует в первую очередь комиксы про все тех же Ходячих.
Указанный пример от преподавателей: Что будет порекомендовано пользователю, который написал отзыв с самой высокой оценкой сентимента?
Сначала нам нужно найти пользователя, который написал этот отзыв. Однако для этого нужно заново сделать сентимент анализ, так как здесь мы группируем не по id книги, а по id пользователя, так как нам нужен именно пользователь, а не комикс
reviews_add <- goodread_reviews %>% right_join(goodread_comics) %>% select(user_id, book_id, review_text, rating)
reviews_tidy_add <- reviews %>% unnest_tokens(words, review_text, token = "words")
stop_words = data.frame(words=stopwords("en"), stringsAsFactors=FALSE)
reviews_tidy_1_add <- reviews_tidy_add %>% anti_join(stop_words)
reviews_tidy_1_add$words <- lemmatize_words(reviews_tidy_1_add$words)
# используем словарь afinn
sentdict = get_sentiments("afinn")
new_tidy_add = reviews_tidy_1_add %>% inner_join(sentdict, by = c("words"="word"))
new_review_sent_add = new_tidy_add %>%
group_by(user_id) %>%
summarize(sent = mean(value))
#наконец, нужный пользователь
new_review_sent_add %>% arrange(-sent) %>% head(1)
## # A tibble: 1 x 2
## user_id sent
## <chr> <dbl>
## 1 6009ef5729d427d9a0ad668d07ef1235 5
Вопрос был связан с тем, что ему порекомендуется. Возьмем для этого функцию к content-based системе:
user_function(2, "6009ef5729d427d9a0ad668d07ef1235")
| Рекомендуемый комикс | Средняя оценка | Вселенная | Описание |
|---|---|---|---|
| V for Vendetta | 4.25 | A new trade paperback edition of the graphic novel that inspired the hit movie! A powerful story about loss of freedom and individuality, V FOR VENDETTA takes place in a totalitarian England following a devastating war that changed the face of the planet. In a world without political freedom, personal freedom and precious little faith in anything comes a mysterious man in a white porcelain mask who fights political oppressors through terrorism and seemingly absurd acts. It’s a gripping tale of the blurred lines between ideological good and evil. This new trade paperback edition features the improved production values and coloring from the 2005 hardcover. |
Ответ: ему рекомендуется комиксы про Вендетту.
Проект завершен, поэтому можно сделать следующие выводы: хорошо проанализировав данный датасет про комиксы, можно создать рекомендательные системы разных видов. При использовании подхода content-based мы рассматривали схожесть комиксов между собой по разным признакам(всленные, названия итд). Что же касается второго метода, коллаборативной фильтрации, то в ней мы рассматривали пользователей и оценки, которые они дали прочитанным комиксам. Первая система рекомендует очень хорошо - при вводе данных зачастую получаем ожидаемый результат. Вторая система местами работает чуть хуже, однако все равно рекомендации актуальны. Более того, возможно, что рекомендации, которые мы оценили как неудачные на первый взгляд, в действительности окажутся актуальными для прльзователя.
Суммируя все вышесказанное, построенными рекомендательными системами можно смело пользоваться, если захотим найти комикс, похожий на те, что нам понравились.
Вопросы: 1) Непонятно как проводилась проверка на адекватность для коллаборативной фильтрации - говорилось, что сравниваются рекомендации пользователя и истинные предпочтения. По каким критериям сравнивались? По жанрам, по издателям? 2. Что использовали для коллаборативной фильтрации - IBCF или UBCF? Почему именно этот способ?
У меня возник вопрос относительно того, какой метод коллаборативной фильтрации был использован: UBCF или IBCF?
IBCF или UBCF? кажется не было указано;
что делать новому юзеру в collaborative filtering?
Какой метод был использован в коллаборативной фильтрации? Какие дал рекомендации?
Ответ: 1) Сравнивались визуально по схожести по вселенным и конкретным комиксам(например, если пользователь любит комикс про Людей Икс, а мы рекомендуем тех же Людей Х, только другую часть, то рекомендация работает хорошо). 2) IBCF, так как дал меньшую ошибку RMSE и MAE. 3) новый юзер получит список из топ комиксов(с наивысшим средним баллом).
Вопрос: Мне непонятно, как id автора (в content-based) помогает искать похожие комиксы, ведь id - это просто набор цифр, который не несет никакой информации о самом авторе. Было бы интересно поподробнее узнать, как на рекомендацию влияет принадлежность комикса к крупным вселенным (Marvel, DC, Image Comics), ведь издательство также есть в числе используемых характеристик. В выводах к коллаборативной фильтрации упоминается, что большинство пользователей оценило 1-2 комикса, значит ли это, что эти пользователи учитывались при построении рекомендательной системы или же порог по количеству оставленных отзывов выше?
Ответ: Никак не помогает, этот момент был исправлен. Принадлежность к крупным вселенным - просто еще одна попытка как-то улучшить content-based систему. Чтобы определить, как именно влияет, нужно строить 2 системы - с этим показателем и без, смотреть на рекомендации, но вряд ли будут ярко выраженные различия в результатах. Насчет порога - мы столкнулись с проблемой, о которой упомянулось в работе: по требованиям в слэке было написано, что должно оставаться более 30% данных, но в нашем случае при пороге больше 1 - такой процент не сохранялся.
Вопросы: 1) Честно говоря, в презентации не очень много кода и представления возможностей построенных систем. Было бы здорово взглянуть на них в лайв режиме.
Хотелось бы, чтобы команда подробнее рассказала об оценке качества рекомендательных систем, чтобы в презентации было продемонстрировано больше кода, освещено больше технических моментов.
Они упомянули сетевой и текстовый анализы, но не показали пример работы или еще что-то, но претензий у меня нет, так как работа выполнена очень качественно и было временное ограничение.
Иногда (в основном в начале презентации) было сложно воспринимать информацию, не отображенную на слайдах, на слух. Так же в части про оценку системы не понятно, что значит “система рекомендует относительно неплохо” и “рекомендации удачны”. Не было информации как были получены эти выводы
Ответ: это не вопросы, а рекомендации/поправки/уточнения, тем не менее:
Наилучшее представление о возможности систем - их функционал, презентуемый через функции. Они демонстрируются в видео.
Довольно трудно объяснять каждый шаг не только теоретически, но и практически за 5 минут, не прибегая к ускорению речи(что делает просмотр труднее)